Skip to content

Commit

Permalink
Merge pull request #81 from saimn/update-requirements
Browse files Browse the repository at this point in the history
Update CI and requirements
  • Loading branch information
saimn authored Dec 7, 2023
2 parents d145f6c + 05b7641 commit ac88234
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 68 deletions.
36 changes: 14 additions & 22 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,42 @@ jobs:
fail-fast: false
matrix:
include:
- name: Python 3.7 with required dependencies
os: macos-latest
python-version: 3.7
toxenv: py37-test

- name: Python 3.8 with required dependencies and measure coverage
os: ubuntu-latest
python-version: 3.8
toxenv: py38-test
coverage: true

- name: Python 3.9 with required dependencies
os: windows-latest
python-version: 3.9
toxenv: py39-test
toxenv: py39-test-numpy122

- name: Python 3.10 with required dependencies
os: ubuntu-latest
python-version: "3.10"
toxenv: py310-test
toxenv: py310-test-numpy124

- name: Python 3.11 with required dependencies
os: macos-latest
python-version: "3.11"
toxenv: py311-test-astropy53

- name: Documentation build
- name: Python 3.12 with required dependencies
os: ubuntu-latest
python-version: 3.8
toxenv: build_docs
python-version: "3.12"
toxenv: py312-test
coverage: true

- name: Code style checks
os: ubuntu-latest
python-version: 3.8
python-version: "3.12"
toxenv: codestyle

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install tox
- name: Install graphviz dependency
if: "endsWith(matrix.toxenv, 'build_docs')"
run: sudo apt-get -y install graphviz
- name: Run tests
if: "! matrix.coverage"
run: tox -v -e ${{ matrix.toxenv }}
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,44 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
python-version: '3.12'

- name: Build wheels
uses: pypa/cibuildwheel@v2.2.2
uses: pypa/cibuildwheel@v2.16.2

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
python-version: '3.12'

- name: Build sdist
run: |
python -m pip install build
python -m build --sdist
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

Expand All @@ -53,12 +57,12 @@ jobs:
# upload to PyPI on every tag
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
- uses: pypa/gh-action-pypi-publish@v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

requires = ["setuptools",
"setuptools_scm",
"wheel",
"extension-helpers==1.*",
"oldest-supported-numpy",
"Cython>=0.29.21,<3.0"]
"numpy>=1.25,<2",
"Cython>=3.0,<3.1"]

build-backend = 'setuptools.build_meta'

[tool.cibuildwheel]
# Skip pypy on mac due to numpy/accelerate issues
skip = "pp37* cp36* cp310-win* cp310-manylinux_x86_64 cp*-manylinux_i686 *musllinux*"
skip = ["pp*", "*musllinux*"]
environment = { PIP_PREFER_BINARY=1 }
test-requires = "pytest scipy"
test-command = "pytest --pyargs astroscrappy"

[tool.cibuildwheel.linux]
archs = ["x86_64"]

[tool.cibuildwheel.windows]
archs = ["AMD64"]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ github_project = astropy/astroscrappy
[options]
zip_safe = False
packages = find:
python_requires = >=3.7
python_requires = >=3.9
setup_requires = setuptools_scm
install_requires =
astropy
Expand Down
44 changes: 15 additions & 29 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
[tox]
envlist =
py{37,38,39,310}-test{,-alldeps,-devdeps}{,-cov}
py{37,38,39,310}-test-numpy{117,118,119,120}
py{37,38,39,310}-test-astropy{30,40,41,lts}
py{39,310,311,312}-test{,-alldeps,-devdeps}{,-cov}
py{39,310,311,312}-test-numpy{122,124,126}
py{39,310,311,312}-test-astropy{53,60}
build_docs
linkcheck
codestyle
requires =
setuptools >= 30.3.0
pip >= 19.3.1
isolated_build = true
indexserver =
NIGHTLY = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple

[testenv]

# Pass through the following environment variables which may be needed for the CI
passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI,TRAVIS,TRAVIS_*,COVERAGE
passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI,COVERAGE

setenv =
MPLBACKEND=agg
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple https://pypi.anaconda.org/astropy/simple

# Run the tests in a temporary directory to make sure that we don't import
# this package from the source tree
Expand All @@ -36,30 +34,18 @@ description =
devdeps: with the latest developer version of key dependencies
oldestdeps: with the oldest supported version of key dependencies
cov: and test coverage
numpy116: with numpy 1.16.*
numpy117: with numpy 1.17.*
numpy118: with numpy 1.18.*
numpy119: with numpy 1.19.*
astropy30: with astropy 3.0.*
astropy40: with astropy 4.0.*
astropy41: with astropy 4.1.*
astropylts: with the latest astropy LTS

# The following provides some specific pinnings for key packages
deps =
numpy116: numpy==1.16.*
numpy117: numpy==1.17.*
numpy118: numpy==1.18.*
numpy119: numpy==1.19.*
numpy120: numpy==1.20.*
numpy122: numpy==1.22.*
numpy124: numpy==1.24.*
numpy126: numpy==1.26.*

astropy30: astropy==3.0.*
astropy40: astropy==4.0.*
astropy41: astropy==4.1.*
astropylts: astropy==4.0.*
astropy53: astropy==5.3.*
astropy60: astropy==6.0.*

devdeps: :NIGHTLY:numpy
devdeps: git+https://github.com/astropy/astropy.git#egg=astropy
devdeps: numpy>=0.0.dev0
devdeps: astropy>=0.0.dev0

# The following indicates which extras_require from setup.cfg will be installed
extras =
Expand Down

0 comments on commit ac88234

Please sign in to comment.