-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TST: NumPy 2.0 and Python 3.12 (#179)
* BUG: Fix a parsing bug in findsat_mrt where suffix extraction fails if there are multiple periods in the path. * TST: NumPy 2.0 and Python 3.12 and also need scipy and scikit-image dev. * Refactor all the CI and publish workflows to use modern infrastructure.
- Loading branch information
Showing
8 changed files
with
179 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,42 @@ | ||
name: Publish to PyPI | ||
name: Wheel building | ||
|
||
on: | ||
release: | ||
types: [released] | ||
pull_request: | ||
# We also want this workflow triggered if the 'Build all wheels' | ||
# label is added or present when PR is updated | ||
types: | ||
- synchronize | ||
- labeled | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish: | ||
uses: spacetelescope/action-publish_to_pypi/.github/workflows/workflow.yml@master | ||
build_and_publish: | ||
# This job builds the wheels and publishes them to PyPI for all | ||
# tags. For PRs with the "Build wheels" label, wheels are built, | ||
# but are not uploaded to PyPI. | ||
|
||
permissions: | ||
contents: none | ||
|
||
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 | ||
|
||
if: (github.repository == 'spacetelescope/acstools' && (github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'Build wheels'))) | ||
with: | ||
test: false | ||
build_platform_wheels: false # Set to true if your package contains a C extension | ||
env: | | ||
jref: "https://ssb.stsci.edu/trds_open/jref" | ||
# We upload to PyPI for all tag pushes | ||
upload_to_pypi: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }} | ||
|
||
test_extras: test,all | ||
test_command: pytest -p no:warnings --pyargs acstools.tests --remote-data -v | ||
|
||
secrets: | ||
user: ${{ secrets.PYPI_USERNAME_STSCI_MAINTAINER }} | ||
password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} # WARNING: Do not hardcode secret values here! If you want to use a different user or password, you can override this secret by creating one with the same name in your Github repository settings. | ||
test_password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER_TEST }} | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
[build-system] | ||
requires = ["setuptools>=30.3.0", | ||
"setuptools_scm", | ||
"wheel"] | ||
"setuptools_scm"] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ keywords = astronomy, astrophysics, calibration | |
author = Matt Davis, Warren Hack, Norman Grogin, Pey Lian Lim, Sara Ogaz, Leonardo Ubeda, Mihai Cara, David Borncamp, Nathan Miles, Tyler Desjardins, Jenna Ryon, David Stark | ||
author_email = [email protected] | ||
license = BSD | ||
license_file = LICENSE.md | ||
license_files = LICENSE.md | ||
url = https://github.com/spacetelescope/acstools | ||
edit_on_github = False | ||
github_project = spacetelescope/acstools | ||
|
@@ -67,7 +67,6 @@ console_scripts = | |
acs_destripe_plus = acstools.acs_destripe_plus:main | ||
|
||
[tool:pytest] | ||
addopts = --doctest-ignore-import-errors | ||
minversion = 5 | ||
testpaths = "acstools" "doc" | ||
norecursedirs = build doc/build | ||
|
@@ -79,11 +78,11 @@ filterwarnings = | |
ignore:unclosed file:ResourceWarning | ||
ignore:distutils Version classes are deprecated:DeprecationWarning | ||
ignore:Deprecation Warning.*timeout.*parameter no longer needed:UserWarning | ||
# This is from skimage import | ||
ignore:.*np\.bool8.*is a deprecated alias:DeprecationWarning | ||
# https://github.com/spacetelescope/crds/issues/922 | ||
ignore:Deprecated call to.*pkg_resources\.declare_namespace.*:DeprecationWarning | ||
ignore:pkg_resources is deprecated as an API:DeprecationWarning | ||
# Python 3.12 warning from dateutil imported by matplotlib | ||
ignore:.*utcfromtimestamp:DeprecationWarning | ||
|
||
[flake8] | ||
# Ignoring these for now: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
[tox] | ||
envlist = | ||
py{38,39,310,311,312}-test{,-alldeps,-devdeps,-predeps} | ||
codestyle | ||
twine | ||
bandit | ||
linkcheck | ||
|
||
[testenv] | ||
# Pass through the following environment variables which are needed for the CI | ||
passenv = HOME,CI,jref | ||
|
||
setenv = | ||
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple | ||
|
||
# Run the tests in a temporary directory to make sure that we don't import | ||
# package from the source tree | ||
changedir = .tmp/{envname} | ||
|
||
# tox environments are constructued with so-called 'factors' (or terms) | ||
# separated by hyphens, e.g. test-devdeps. Lines below starting with factor: | ||
# will only take effect if that factor is included in the environment name. To | ||
# see a list of example environments that can be run, along with a description, | ||
# run: | ||
# | ||
# tox -l -v | ||
# | ||
description = | ||
run tests | ||
alldeps: with all optional dependencies | ||
devdeps: with the latest developer version of key dependencies | ||
predeps: with the pre-release version of key dependencies | ||
|
||
deps = | ||
# The devdeps factor is intended to be used to install the latest developer version | ||
# or nightly wheel of key dependencies. | ||
devdeps: numpy>=0.0.dev0 | ||
devdeps: scipy>=0.0.dev0 | ||
devdeps: matplotlib>=0.0.dev0 | ||
devdeps: scikit-image>=0.0.dev0 | ||
devdeps: astropy>=0.0.dev0 | ||
devdeps: git+https://github.com/astropy/photutils.git | ||
devdeps: git+https://github.com/spacetelescope/ci_watson.git | ||
devdeps: stsci.tools | ||
|
||
extras = | ||
test | ||
alldeps: all | ||
predeps: all | ||
|
||
commands = | ||
# Force numpy-dev after matplotlib downgrades it (https://github.com/matplotlib/matplotlib/issues/26847) | ||
devdeps: python -m pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy | ||
pip freeze | ||
pytest --pyargs acstools {toxinidir}/doc {posargs} | ||
|
||
pip_pre = | ||
predeps: true | ||
!predeps: false | ||
|
||
[testenv:codestyle] | ||
skip_install = true | ||
changedir = {toxinidir} | ||
description = check code style with flake8 | ||
deps = flake8 | ||
commands = flake8 acstools --count | ||
|
||
[testenv:twine] | ||
skip_install = true | ||
changedir = {toxinidir} | ||
description = twine check dist tarball | ||
deps = | ||
build | ||
twine>=3.3 | ||
commands = | ||
pip freeze | ||
python -m build --sdist . | ||
twine check --strict dist/* | ||
|
||
[testenv:bandit] | ||
skip_install = true | ||
changedir = {toxinidir} | ||
description = Security audit with bandit | ||
deps = bandit | ||
commands = | ||
pip freeze | ||
bandit -r acstools -c .bandit.yaml | ||
|
||
[testenv:linkcheck] | ||
changedir = doc | ||
description = check the links in the HTML docs | ||
extras = docs | ||
allowlist_externals = make | ||
commands = | ||
pip freeze | ||
make linkcheck |