Skip to content

Commit

Permalink
Add romancal as dep for tox env
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Nov 22, 2024
1 parent be9dbb9 commit e1f6793
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -34,20 +35,26 @@ jobs:
envs: |
- linux: rad
latest_crds_contexts:
uses: ./.github/workflows/contexts.yml
crds_context:
needs: [ latest_crds_contexts ]
environment:
runs-on: ubuntu-latest
steps:
- id: context
run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.roman) || needs.latest_crds_contexts.outputs.roman }} >> $GITHUB_OUTPUT
- id: data_path
run: echo "path=${{ runner.temp }}/data" >> $GITHUB_OUTPUT
outputs:
context: ${{ steps.context.outputs.context }}
test_with_romancal:
needs: [ crds_context ]
data_path: ${{ steps.data_path.outputs.path }}
crds_contexts:
uses: ./.github/workflows/contexts.yml
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: romancal
coverage: codecov
17 changes: 13 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[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

Expand All @@ -16,6 +16,8 @@ requires =
#
# tox -l -v
#
[main]
rcal_repo = https://github.com/spacetelescope/romancal.git

[testenv:check-style]
skip_install = true
Expand All @@ -34,6 +36,8 @@ description =
warnings: treating warnings as errors
cov: with coverage
xdist: using parallel processing
allowlist_externals =
git
pass_env =
CRDS_*
HOME
Expand All @@ -48,16 +52,21 @@ extras =
uv_resolution =
oldestdeps: lowest-direct
deps =
withromancal: romancal @ git+{[main]rcal_repo}
xdist: pytest-xdist
cov: pytest-cov >= 4.1.0
rad: rad @ git+https://github.com/spacetelescope/rad.git@main#egg=rad
romancal: romancal[test] @ git+https://github.com/spacetelescope/romancal.git
romancal: romancal[test] @ git+{[main]rcal_repo}
devdeps: -r requirements-dev.txt
change_dir =
romancal: {env_tmp_dir}
commands_pre =
{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 \
romancal: -W ignore::DeprecationWarning -W ignore::UserWarning -W ignore::SyntaxWarning -W ignore::pytest.PytestUnknownMarkWarning -W ignore::pytest.PytestUnraisableExceptionWarning -W ignore::erfa.core.ErfaWarning -W ignore::roman_datamodels.datamodels._utils.FilenameMismatchWarning -W ignore::astropy.io.fits.verify.VerifyWarning -W ignore::RuntimeWarning --pyargs romancal \
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}
Expand Down

0 comments on commit e1f6793

Please sign in to comment.