From b20756b5bdb1adc927ddd7e45c7fdd0fed08fabf Mon Sep 17 00:00:00 2001 From: Benjamin Johnson Date: Tue, 26 Mar 2024 19:08:35 -0400 Subject: [PATCH] remove six requirement; fix toml bug; start on release workflow. --- .github/workflows/release.yml | 77 +++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 8 ++-- prospect/fitting/nested.py | 1 - pyproject.toml | 2 +- requirements.txt | 3 +- 5 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c181a8b1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,77 @@ +name: Release +on: + push: + branches: + - main + tags: + - "*" + # pull_request: + workflow_dispatch: + inputs: + prerelease: + description: "Run a pre-release, testing the build" + required: false + type: boolean + default: false + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_wheels: + name: Build wheel for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - "ubuntu-22.04" + - "macos-14" + steps: + - uses: pypa/cibuildwheel@v2.16.5 + - uses: actions/upload-artifact@v4 + with: + name: binary-${{ matrix.os }} + path: ./wheelhouse/*.whl + + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U build twine + - name: Build sdist + run: | + python -m pip install -U pip + python -m build --sdist . + - uses: actions/upload-artifact@v4 + with: + path: dist/*.tar.gz + + publish: + environment: + name: pypi + url: https://pypi.org/p/fsps + permissions: + id-token: write + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + - uses: pypa/gh-action-pypi-publish@v1.8.12 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ec6e8e71..20806e1f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,13 +16,13 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - name: Clone the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Clone fsps - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: cconroy20/fsps path: fsps @@ -31,7 +31,7 @@ jobs: python -m pip install -U pip pytest python -m pip install -U fsps astro-sedpy astropy python -m pip install -U scipy - python -m pip install -U six dynesty + python -m pip install -U dynesty python -m pip install . env: SPS_HOME: ${{ github.workspace }}/fsps diff --git a/prospect/fitting/nested.py b/prospect/fitting/nested.py index 26ef52fe..73d7ed1e 100644 --- a/prospect/fitting/nested.py +++ b/prospect/fitting/nested.py @@ -1,7 +1,6 @@ import sys, time import numpy as np from numpy.random import normal, multivariate_normal -from six.moves import range try: import nestle diff --git a/pyproject.toml b/pyproject.toml index 2c7a41cb..f1d1e2a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ authors = [ { name="Ben Johnson", email="benjamin.johnson@cfa.harvard.edu" }, ] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">= 3.9" license = { text = "MIT License" } classifiers = [ "Development Status :: 5 - Production/Stable", diff --git a/requirements.txt b/requirements.txt index 8947ebd2..f22d33ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,4 @@ numpy >= 1.14.2 scipy >= 1.1.0 astropy h5py -astro-sedpy -six \ No newline at end of file +astro-sedpy \ No newline at end of file