Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,49 @@
[pypi link]: https://pypi.org/project/astrodata
[citation link]: https://github.com/GeminiDRSoftware/astrodata/blob/main/CITATION.md
[DRAGONS citation]: https://zenodo.org/records/10841622
[zenodo DOI link]: https://doi.org/10.5281/zenodo.14804282
[pyopensci review link]: https://github.com/pyOpenSci/software-review/issues/181

[coverage badge]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/teald/d2f3af2a279efc1f6e90d457a3c50e47/raw/covbadge.json
[docs build badge]: https://github.com/GeminiDRSoftware/astrodata/actions/workflows/documentation.yml/badge.svg
[pypi packaging badge]: https://github.com/GeminiDRSoftware/astrodata/actions/workflows/publish_pypi.yml/badge.svg
[pypi package version badge]: https://badge.fury.io/py/astrodata.svg
[source test status badge]: https://github.com/GeminiDRSoftware/astrodata/actions/workflows/source_tests.yml/badge.svg
[build test status badge]: https://github.com/GeminiDRSoftware/astrodata/actions/workflows/build_tests.yml/badge.svg
[zenodo DOI badge]: https://zenodo.org/badge/DOI/10.5281/zenodo.14804282.svg
[pyopensci peer review badge]: https://pyopensci.org/badges/peer-reviewed.svg

`astrodata`
=============

<picture>
<p align="center">
<source media="(prefers-color-scheme: dark)" srcset="docs/static/logo.svg">
<img
alt="A logo of a stylized blue dragon inside a similarly blue shell. A yellow star lies at the center, together with the dragon shape forming a stylized letter A."
src="docs/static/logo_dark.svg"
align="left"
height=200
style="padding-right: 10; padding-bottom: 10; border: none;"
style="display: block; width: 20%; height: auto; float: center"
>
</picture>
</p>


`astrodata`
=============
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
![Supported python versions -- 3.10, 3.11, and 3.12](https://img.shields.io/badge/3.10|3.11|3.12-%234b8bbe?logo=Python&logoColor=%234b8bbe&label=For%20Python%3A)
[![PyPI version badge][pypi package version badge]](https://badge.fury.io/py/astrodata)
[![DOI Badge][zenodo DOI badge]][zenodo DOI link]
[![pyOpenSci Peer Reviewed][pyopensci peer review badge]][pyopensci review link]

### Tests
![A badge displaying the testing coverage percentage of this repository.][coverage badge]
![Source test status badge][source test status badge]
![Build/Release test status badge][build test status badge]


### Building & Publishing
![Documentation build status badge][docs build badge]
![pypi packaging status badge][pypi packaging badge]
[![PyPI version badge][pypi package version badge]](https://badge.fury.io/py/astrodata)





<!-- Clearing the logo for the next header -->
<br clear="left">
Expand Down
31 changes: 28 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def install_test_dependencies(
session.install("-r", str(req_file_path))

else:
session.conda_install("--file", str(req_file_path))
session.conda_install("--quiet", "--file", str(req_file_path))


def apply_macos_config(session: nox.Session) -> None:
Expand All @@ -474,28 +474,39 @@ def apply_macos_config(session: nox.Session) -> None:
session.log("Setting CONDA_SUBDIR to osx-64.")


def apply_data_caching_environment_variable(session: nox.Session) -> None:
"""Add a test caching env var to the session's environment."""
default_test_cache_path = str(Path(os.getcwd()) / "_test_cache")

session.env["ASTRODATA_TEST"] = (
os.getenv("ASTRODATA_TEST") or default_test_cache_path
)


@nox.session(
venv_backend="conda",
venv_params=SessionVariables.dragons_venv_params,
python="3.10",
)
def dragons_release_tests(session: nox.Session) -> None:
"""Run the tests for the DRAGONS conda package."""
apply_data_caching_environment_variable(session)
apply_macos_config(session)

# Fetch test dependencies from the poetry.lock file.
install_test_dependencies(session)

# Install the DRAGONS package, and ds9 for completeness.
session.conda_install(
"--quiet",
"dragons==3.2",
"ds9",
channel=SessionVariables.dragons_conda_channels,
)

# Need to downgrade numpy because of DRAGONS issue 464
# https://github.com/GeminiDRSoftware/DRAGONS/issues/464
session.conda_install("numpy=1.26")
session.conda_install("--quiet", "numpy=1.26")

session.install("-e", f"{SessionVariables.noxfile_dir()}", "--no-deps")

Expand All @@ -512,6 +523,7 @@ def dragons_release_tests(session: nox.Session) -> None:
@nox.session(venv_backend="conda", python="3.10", tags=["dragons"])
def dragons_dev_tests(session: nox.Session) -> None:
"""Run the tests for the DRAGONS conda package."""
apply_data_caching_environment_variable(session)
apply_macos_config(session)

# Fetch test dependencies from the poetry.lock file.
Expand Down Expand Up @@ -586,6 +598,7 @@ def dragons_dev_tests(session: nox.Session) -> None:
@nox.session(python=SessionVariables.python_versions)
def unit_tests(session: nox.Session) -> None:
"""Run the unit tests."""
apply_data_caching_environment_variable(session)
install_test_dependencies(session)
session.install("-e", ".", "--no-deps")

Expand All @@ -600,6 +613,7 @@ def unit_tests(session: nox.Session) -> None:
def conda_unit_tests(session: nox.Session) -> None:
"""Run the unit tests."""
# Configure session channels.
apply_data_caching_environment_variable(session)
session.run(
"conda",
"config",
Expand All @@ -623,6 +637,8 @@ def unit_test_build(session: nox.Session) -> None:

This is meant to be called from the `build_tests` session.
"""
apply_data_caching_environment_variable(session)

# Install the package from the devpi server
install_test_dependencies(session, poetry_groups=["test"])

Expand All @@ -643,21 +659,23 @@ def integration_test_build(session: nox.Session) -> None:

This is meant to be called from the `build_tests` session.
"""
apply_data_caching_environment_variable(session)
apply_macos_config(session)

# Fetch test dependencies from the poetry.lock file.
install_test_dependencies(session)

# Install the DRAGONS package, and ds9 for completeness.
session.conda_install(
"--quiet",
"dragons==3.2",
"ds9",
channel=SessionVariables.dragons_conda_channels,
)

# Need to downgrade numpy because of DRAGONS issue 464
# https://github.com/GeminiDRSoftware/DRAGONS/issues/464
session.conda_install("numpy=1.26")
session.conda_install("--quiet", "numpy=1.26")
session.install("astrodata")

# Positional arguments after -- are passed to pytest.
Expand All @@ -673,6 +691,8 @@ def integration_test_build(session: nox.Session) -> None:
@nox.session
def coverage(session: nox.Session) -> None:
"""Run the tests and generate a coverage report."""
apply_data_caching_environment_variable(session)

# Install the test dependencies.
install_test_dependencies(session)

Expand Down Expand Up @@ -765,6 +785,7 @@ def build_tests_unit(session: nox.Session) -> None:
This session will build the package, upload it to an isolated devpi server,
and run the tests using the build version of the package.
"""
apply_data_caching_environment_variable(session)
build_and_publish_to_devpi(session)

working_dir = Path(session.create_tmp())
Expand All @@ -781,6 +802,7 @@ def build_tests_integration(session):
This session will build the package, upload it to an isolated devpi server,
and run the tests using the build version of the package.
"""
apply_data_caching_environment_variable(session)
build_and_publish_to_devpi(session)

working_dir = Path(session.create_tmp())
Expand All @@ -792,6 +814,7 @@ def build_tests_integration(session):
@nox.session(python=SessionVariables.python_versions)
def script_tests(session: nox.Session) -> None:
"""Run the script tests."""
apply_data_caching_environment_variable(session)
install_test_dependencies(session)
session.install("-e", ".", "--no-deps")

Expand All @@ -803,6 +826,7 @@ def script_tests(session: nox.Session) -> None:
@use_devpi_server
def build_tests_scripts(session: nox.Session) -> None:
"""Run the script tests using the build version of the package."""
apply_data_caching_environment_variable(session)
build_and_publish_to_devpi(session)

working_dir = Path(session.create_tmp())
Expand Down Expand Up @@ -1029,6 +1053,7 @@ def dragons_calibration(
) -> None:
"""Run the calibration tests."""
session.conda_install(
"--quiet",
"dragons==3.2",
channel=SessionVariables.dragons_conda_channels,
)
Expand Down
Loading
Loading