diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1005dc6..5e354ec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,8 @@ jobs: - linux: py310 - linux: py311-cov coverage: codecov - - linux: py312 + - linux: py312-withromancal-cov + coverage: codecov - linux: py313 - macos: py311 test_upstream: @@ -33,9 +34,26 @@ jobs: with: envs: | - linux: rad - test_with_romancal: + + environment: + runs-on: ubuntu-latest + steps: + - id: data_path + run: echo "path=${{ runner.temp }}/data" >> $GITHUB_OUTPUT + outputs: + data_path: ${{ steps.data_path.outputs.path }} + crds_contexts: + uses: spacetelescope/crds/.github/workflows/contexts.yml@master + romancal: + needs: [ environment, crds_contexts ] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 with: + setenv: | + CRDS_PATH: ${{ needs.environment.outputs.data_path }}/crds + CRDS_SERVER_URL: https://roman-crds.stsci.edu + CRDS_CLIENT_RETRY_COUNT: 3 + CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 + cache-path: ${{ needs.environment.outputs.data_path }}/crds + cache-key: crds-${{ needs.crds_contexts.outputs.roman }} envs: | - - linux: withromancal - coverage: codecov + - linux: romancal diff --git a/pyproject.toml b/pyproject.toml index 325beef7..c01ff653 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ dependencies = [ "asdf >=3.3.0", "asdf-astropy >=0.5.0", "gwcs >=0.19.0", - "numpy >=1.22", + "numpy >=1.24", "astropy >=5.3.0", "rad >=0.22.0, <0.23.0", # "rad @ git+https://github.com/spacetelescope/rad.git", @@ -29,7 +29,7 @@ file = "LICENSE" test = [ "pytest >=6.0.0", "pytest-doctestplus", - "pytest-doctestplus >=0.10.0", + "pytest-doctestplus >=1.2.1", "pytest-env >= 0.8", ] aws = ["stsci-aws-utils >= 0.1.2"] @@ -63,7 +63,10 @@ minversion = 4.6 doctest_plus = true doctest_rst = true text_file_format = "rst" -addopts = "--color=yes --doctest-rst" +addopts = [ + "--color=yes", + "--doctest-rst", +] testpaths = ["tests"] filterwarnings = [ "error", diff --git a/requirements-dev.txt b/requirements-dev.txt index f42d2cc6..5cfb2054 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,11 +5,9 @@ git+https://github.com/asdf-format/asdf-wcs-schemas git+https://github.com/astropy/asdf-astropy # Use weekly astropy dev build ---extra-index-url https://pypi.anaconda.org/astropy/simple astropy --pre ---extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa --pre +astropy>=0.0.dev0 +pyerfa>=0.0.dev0 -# Use Bi-weekly numpy/scipy dev builds ---extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 scipy>=0.0.dev0 diff --git a/tox.ini b/tox.ini index 5e0cb04a..aa381685 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,12 @@ [tox] env_list = check-{style,build} - test{,-devdeps}{,-pyargs,-cov}-xdist + test{,-devdeps}{,-pyargs,-cov}-xdist-withromancal test-numpy{120,121,122}-xdist build-{docs,dist} - withromancal + romancal +requires = + tox-uv # tox environments are constructed with so-called 'factors' (or terms) # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: @@ -14,6 +16,8 @@ env_list = # # tox -l -v # +[main] +rcal_repo = https://github.com/spacetelescope/romancal.git [testenv:check-style] skip_install = true @@ -32,27 +36,41 @@ description = warnings: treating warnings as errors cov: with coverage xdist: using parallel processing +allowlist_externals = + git pass_env = CRDS_* HOME CI TOXENV CODECOV_* +set_env = + devdeps: UV_INDEX = https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + devdeps: UV_INDEX_STRATEGY = unsafe-any-match extras = test +uv_resolution = + oldestdeps: lowest-direct deps = + withromancal: romancal @ git+{[main]rcal_repo} xdist: pytest-xdist - cov: pytest-cov - oldestdeps: minimum_dependencies + cov: pytest-cov >= 4.1.0 rad: rad @ git+https://github.com/spacetelescope/rad.git@main#egg=rad + romancal: setuptools # for pkg_resources for pysiaf + romancal: romancal[test] @ git+{[main]rcal_repo} + devdeps: -r requirements-dev.txt + oldestdeps: minimum_dependencies +change_dir = + romancal: {env_tmp_dir} commands_pre = - oldestdeps: minimum_dependencies roman_datamodels --filename requirements-min.txt - oldestdeps: pip install -r requirements-min.txt - devdeps: pip install -r requirements-dev.txt -U --upgrade-strategy eager - pip freeze + oldestdeps: minimum_dependencies roman_datamodels --filename {env_tmp_dir}/requirements-min.txt + oldestdeps: uv pip install -r {env_tmp_dir}/requirements-min.txt + {list_dependencies_command} + romancal: git clone -n --depth=1 --filter=blob:none {[main]rcal_repo} + romancal: git --git-dir={envtmpdir}/romancal/.git checkout HEAD pyproject.toml commands = pytest \ - warnings: -W error \ + romancal: --config-file={env_tmp_dir}/pyproject.toml --pyargs romancal \ xdist: -n auto \ cov: --cov=roman_datamodels --cov=tests --cov-config pyproject.toml --cov-report term-missing --cov-report xml \ {posargs} @@ -70,19 +88,3 @@ deps = build commands = python -m build . - -[testenv:withromancal] -allowlist_externals = - git - bash -deps = - pytest-cov -commands_pre = - bash -c "pip freeze -q | grep 'roman_datamodels @' > {env_tmp_dir}/requirements.txt" - pip install git+https://github.com/spacetelescope/romancal.git - pip install -r {env_tmp_dir}/requirements.txt - pip freeze -commands = - pytest tests/test_open.py::test_open_asn \ - --cov=tests --cov-config pyproject.toml --cov-report term-missing --cov-report xml \ - {posargs}