From ec4095184805ee1d689bb233932a9399edb87488 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:28:16 -0500 Subject: [PATCH] Stop using oldest-supported-numpy (#107) * Stop using oldest-supported-numpy because Python 3.12 does not work with numpy < 1.19. Also update minimum required python to 3.9. --- .github/workflows/ci_workflows.yml | 52 ++++++++++++++------- .readthedocs.yml | 13 +++++- .travis.yml | 75 ------------------------------ pyproject.toml | 4 +- requirements_dev.txt | 3 -- setup.cfg | 4 +- tox.ini | 6 +-- 7 files changed, 54 insertions(+), 103 deletions(-) delete mode 100644 .travis.yml delete mode 100644 requirements_dev.txt diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index 35d65c9..7f6b98a 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -4,6 +4,10 @@ on: push: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: tests: name: ${{ matrix.name }} [ ${{ matrix.os }} ] @@ -12,29 +16,29 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: [3.8] + python: [3.9] toxenv: [test] toxargs: [-v] include: - name: Test with oldest supported versions of our dependencies - os: ubuntu-18.04 - python: 3.7 + os: ubuntu-20.04 + python: 3.9 toxenv: test-oldestdeps toxargs: -v - name: Test with medium old supported versions of our dependencies # Test that we do not have a problem with some specific version (gh-101). # Comment out if not needed. - os: ubuntu-20.04 + os: ubuntu-22.04 python: 3.9 toxenv: test-olddeps toxargs: -v - name: Test with development versions of our dependencies os: ubuntu-latest - python: 3.11 + python: '3.11' toxenv: test-devdeps toxargs: -v @@ -53,12 +57,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: true - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: Install APT packages @@ -84,19 +88,19 @@ jobs: - name: Tests with external liberfa os: ubuntu-latest - python: 3.8 + python: 3.9 toxenv: test toxargs: -v apt_packages: python3-venv python3-pip liberfa-dev python3-numpy steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: true - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: Install APT packages @@ -120,16 +124,30 @@ jobs: test_command: pytest --pyargs erfa targets: | # Linux wheels - - cp*-manylinux_i686 - - cp*-manylinux_x86_64 - - cp*-musllinux_x86_64 - - cp*-manylinux_aarch64 + - cp39-manylinux_x86_64 + - cp310-manylinux_x86_64 + - cp311-manylinux_x86_64 + - cp39-musllinux_x86_64 + - cp310-musllinux_x86_64 + - cp311-musllinux_x86_64 + - cp39-manylinux_aarch64 + - cp310-manylinux_aarch64 + - cp311-manylinux_aarch64 # MacOS X wheels - we deliberately do not build universal2 wheels. # Note that the arm64 wheels are not actually tested so we # rely on local manual testing of these to make sure they are ok. - - cp*-macosx_x86_64 - - cp*-macosx_arm64 + - cp39*macosx_x86_64 + - cp310*macosx_x86_64 + - cp311*macosx_x86_64 + - cp39*macosx_arm64 + - cp310*macosx_arm64 + - cp311*macosx_arm64 # Windows wheels - - cp*-win* + - cp39*win32 + - cp310*win32 + - cp311*win32 + - cp39*win_amd64 + - cp310*win_amd64 + - cp311*win_amd64 secrets: pypi_token: ${{ secrets.pypi_token }} diff --git a/.readthedocs.yml b/.readthedocs.yml index 9f7576e..2626f7b 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,12 +1,23 @@ version: 2 build: - image: latest + os: ubuntu-22.04 + tools: + python: "3.11" + jobs: + post_checkout: + - git fetch --shallow-since=2023-01-01 || true submodules: include: all +sphinx: + builder: html + configuration: docs/conf.py + fail_on_warning: false + python: + system_packages: false install: - method: pip path: . diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a0606a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,75 +0,0 @@ -language: python - -python: 3.8 - -# We need a full clone to make sure setuptools_scm works properly -git: - depth: false - -os: - - linux - -dist: bionic - -stages: - # Do a single test job, don't proceed if it fails - - name: Initial tests - # Test docs and (eventually) dev. - - name: Comprehensive tests - # These will only run when cron is opted in - - name: Cron tests - if: type = cron - -env: - global: - # The following versions are the 'default' for tests, unless - # overridden underneath. They are defined here in order to save having - # to repeat them for all configurations. - - SETUP_METHOD='tox' - - # The following three variables are for tox. TOXENV is a standard - # variable that tox uses to determine the environment to run, - # TOXARGS are arguments passed to tox, and TOXPOSARGS are arguments - # that tox passes through to the {posargs} indicator in tox.ini. - # The latter can be used for example to pass arguments to pytest. - - TOXENV='test' - - TOXARGS='-v' - - TOXPOSARGS='' - -jobs: - include: - - # We try our apt test on the big-endian s390x architecture, - # to check that things work there as well. We also test that - # we can use a system library. - - name: install with apt - stage: Comprehensive tests - arch: s390x - language: c - dist: focal - env: SETUP_METHOD='apt' - PYERFA_USE_SYSTEM_LIBERFA=1 - addons: - apt: - packages: - - python3-venv # build dependencies - - python3-pip - - liberfa-dev - - python3-numpy - - python3-pytest-astropy - -install: - - if [[ $SETUP_METHOD == 'tox' ]]; then - pip install tox; - fi - -script: - - if [[ $SETUP_METHOD == 'tox' ]]; then - tox $TOXARGS -- $TOXPOSARGS; - else - python3 -m venv --system-site-packages tests; - source tests/bin/activate; - pip3 install --no-deps --editable .[test]; - (nm -u erfa/ufunc.cpython-*.so | grep eraA2af) || exit 1; - (python -c 'import erfa' 2>&1 | grep -n 'too old') > /dev/null && (echo 'liberfa too old, skipping tests'; exit 0) || pytest-3; - fi diff --git a/pyproject.toml b/pyproject.toml index 16f3b9a..14b3409 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ [build-system] -requires = ["setuptools", "setuptools_scm[toml]>=6.2", "wheel", - "packaging", "jinja2>=2.10.3", "oldest-supported-numpy"] +requires = ["setuptools", "setuptools_scm[toml]>=6.2", + "packaging", "jinja2>=2.10.3", "numpy>=1.25,<2"] build-backend = 'setuptools.build_meta' diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index b20730a..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -wheel -numpy>=1.16 -jinja2==2.11.3 diff --git a/setup.cfg b/setup.cfg index 4c1cb04..aaeabeb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,8 +24,8 @@ requires = numpy zip_safe = False tests_require = pytest-doctestplus setup_requires = setuptools_scm -install_requires = numpy>=1.17 -python_requires = >=3.7 +install_requires = numpy>=1.19 +python_requires = >=3.9 [options.packages.find] exclude = erfa._dev diff --git a/tox.ini b/tox.ini index 86fe79f..10539a3 100644 --- a/tox.ini +++ b/tox.ini @@ -12,10 +12,10 @@ isolated_build = true [testenv] # Pass through the following environemnt variables which may be needed for the CI -passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI,TRAVIS +passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI setenv = - devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scipy-wheels-nightly/simple + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple # Run the tests in a temporary directory to make sure that we don't import # pyerfa from the source tree @@ -37,7 +37,7 @@ description = # The following provides some specific pinnings for key packages deps = - oldestdeps: numpy==1.17.* # astropy LTS + oldestdeps: numpy==1.19.* # astropy LTS olddeps: numpy==1.20.* # something potentially problematic (see gh-101) devdeps: numpy>=0.0.dev0