Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic developer environment creation #470

Draft
wants to merge 54 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6980c94
ci(nox): Initial noxfile.
teald Dec 2, 2024
c14bc33
ci(nox): Add venv command to session
teald Dec 2, 2024
83d0f78
ci(nox): Pass positional arguments to venv if given.
teald Dec 3, 2024
c3b6e1e
ci(nox): Add catch for venv prompt w/o venv path
teald Dec 3, 2024
5f73521
ci(nox): Extract venv's path into variable.
teald Dec 3, 2024
a715a6f
ci(nox): Extract venv creation to helper function.
teald Dec 3, 2024
8a7b92c
ci(nox): Remove fluff for custom dirs/prompts
teald Dec 3, 2024
b6c4a68
ci(nox): Add arguments to venv, install package
teald Dec 3, 2024
fb5607e
ci(nox): Add dep to pyproject.toml, read in nox
teald Dec 3, 2024
deef281
doc(nox): Initial developer documentation
teald Dec 3, 2024
316e0ef
fix(nox): Open pyproject.toml in binary read mode
teald Dec 3, 2024
09b7ff4
fix(nox): Use correct install method for venvs
teald Dec 3, 2024
93a1d51
test(nox): Add tests for dev envs
teald Dec 3, 2024
04c6d0a
ci(nox): Add devconda session
teald Dec 4, 2024
df62a11
ci(nox): Add initial devconda session impl
teald Dec 4, 2024
db9804c
test(nox): Testing for devconda environment
teald Dec 4, 2024
396ced9
ci(nox): Add devconda removal session.
teald Dec 4, 2024
efb416c
fix(nox): Add python specification to command if not an arg
teald Dec 4, 2024
cb8c618
ci(nox): Add dependency installation for devconda.
teald Dec 4, 2024
9e51c3b
test(nox): Test devconda dependency install
teald Dec 5, 2024
29e7ca4
ci(nox): Add pre-commit installation.
teald Dec 5, 2024
b9aa1c6
docs(dev): Add to dev docs.
teald Dec 5, 2024
482223b
ci(nox): Add python version validation.
teald Dec 5, 2024
f850881
ci(nox): Fix missing str to match regex
teald Dec 5, 2024
c9c0f2d
fix(nox): Use tuple, not str for version arg
teald Dec 5, 2024
47ff7cc
ci(nox): Add external flag to python version call.
teald Dec 6, 2024
0326049
ci(pre-commit): Add initial pre-commit hooks
teald Dec 11, 2024
25781df
ci(nox): Add development tests to nox.
teald Dec 11, 2024
0162998
docs(ci): Add initial CI docs page.
teald Dec 11, 2024
ab1d967
ci(actions): Add dev tests workflow.
teald Dec 11, 2024
c8d84b5
chore: Archive old_ directories.
teald Dec 11, 2024
88e6730
docs(ci): Rewording
teald Dec 11, 2024
6b49b3d
chore(lint): Initial link with pre-commit hooks
teald Dec 12, 2024
736ecf1
ci(nox): Add noc lint session
teald Dec 12, 2024
ea5ce28
chore(lint): Apply mdformatter to *.md files.
teald Dec 12, 2024
18b3b0a
fix(docs): Links with trailing underscore
teald Dec 12, 2024
8ac4ea4
ci(blame): Update git blame ignored commits.
teald Dec 12, 2024
075df89
ci(blame): Update .git-blame-ignore-revs after rebase.
teald Dec 12, 2024
557b683
test(dev): Update github workflow nox session
teald Dec 12, 2024
61ef758
ci: Remove defaults channel
teald Dec 12, 2024
6571a39
chore(nox): Update quotes.
teald Dec 12, 2024
152ba41
ci(dev): Remove python 3.10
teald Dec 12, 2024
e256e7b
ci(lint): Add initial linting workflow
teald Dec 12, 2024
27f1940
ci(lint): Add python version specification to action
teald Dec 12, 2024
18ba4be
ci(dev): Update test to use nox actions
teald Dec 12, 2024
8ab9a5a
ci(pre-commit): Update pre-commit repo
teald Dec 12, 2024
7755535
ci(lint): Rename workflow
teald Dec 12, 2024
12d7a87
ci(pre-commit): Update pre-commit config, add lint/format (off)
teald Dec 13, 2024
b9fd06d
chore(README): Format README.
teald Dec 13, 2024
c2efc08
ci(dev): Update python, conda installs.
teald Dec 13, 2024
3106741
ci(unit): Update unit test name
teald Dec 13, 2024
ffebc44
fix(ci): Add nox install to dev tests
teald Dec 13, 2024
2867381
test(dev): Update conda environment removal
teald Dec 13, 2024
b027496
test(devenv): Add tests for obs_db/calmgr deps
teald Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Migration commits for linting, formatting
a008125e8203ae7245af8af945846ae54e0d51c4
7d9f5008ae77a7ded8c721e952f958e56c4174f5
977964573e4260c096d6f74ec908da7d810f1e80
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ coverage:
# extension:
# https://github.com/codecov/browser-extension
target: auto
threshold: 1%
threshold: 1%
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ updates:
schedule:
interval: daily
time: "09:00"
open-pull-requests-limit: 10
open-pull-requests-limit: 10
48 changes: 48 additions & 0 deletions .github/workflows/dev_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run development tests

on:
pull_request:
push:
workflow_dispatch:
schedule:
# Run every Sunday at 03:53 UTC
- cron: 53 3 * * 0

jobs:
dev_tests:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: [
"3.11",
"3.12",
"3.13",
]

os:
- ubuntu-latest
- macos-latest

steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
conda-remove-defaults: true
miniforge-version: latest

- name: Install python
uses: actions/setup-python@v5
with:
python-version: |
3.11
3.12
3.13


- name: Run dev tests
run: |
python -m pip install nox
nox -s run_dev_tests -- -vv
43 changes: 43 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Linting and format-checking workflow for the repository.
#
# Behavior in this file, other than setup, is controlled in the file
# .pre-commit-config.yaml in the top directory of the repository.
#
# Any automations should be added to that file. This check runs over the entire
# repository, not just changes.
name: Lint repository

on:
pull_request:
push:
workflow_dispatch:
schedule:
# Run every Sunday at 03:53 UTC
- cron: 53 3 * * 0

jobs:
lint:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.12"]
os:
- ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}


- name: Install packages
shell: bash -l {0}
run: python -m pip install nox

- name: Run pre-commit via nox
shell: bash -l {0}
run: |
nox -s lint
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- cron: 53 3 * * 0

jobs:
tests:
unit_tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
1 change: 0 additions & 1 deletion .jenkins/Jenkinsfile_conda
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,3 @@ pipeline {
}
}
}

1 change: 0 additions & 1 deletion .jenkins/scripts/setup_dirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ if [[ -n "${DRAGONS_TEST_OUT-}" ]]; then
else
echo "DRAGONS_TEST_OUT is not set, so not deleting it"
fi

1 change: 0 additions & 1 deletion .jenkins/scripts/update_files_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ chmod -Rv 775 $DRAGONS_TEST_INPUTS || echo 1
chmod -Rv 775 $DRAGONS_TEST_OUTPUTS || echo 1

chmod -Rv 775 $DRAGONS_TEST_REFS || echo 1

68 changes: 68 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# pre-commit configuration for DRAGONS
#
# Please follow these guidelines:
#
# 1) All linting behavior can & should be defined in this file. For example,
# that includes:
#
# + Formatting
# + Syntax/type checks
# + Commit protections/standards
#
# 2) Do not include any tests involving the execution of this software, under
# any circumstances.
#
# 3) This should be a superset of the NOIRLab Python Standard, which can be
# found here:
#
# https://github.com/teald/python-standard-template/blob/main/.pre-commit-config.yaml
default_stages: [pre-commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-docstring-first
exclude: "archived/"
- id: check-case-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-symlinks
- id: check-vcs-permalinks
- id: forbid-submodules

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.18 # Use the ref you want to point at
hooks:
- id: mdformat
# Optionally add plugins
additional_dependencies:
- mdformat-gfm
- mdformat-black
args: ['--wrap=80']

# Below is the formatter (to be turned on after pyproject.toml update)
# # Mirror uses compiled black, so faster.
# - repo: https://github.com/psf/black-pre-commit-mirror
# rev: 24.8.0
# hooks:
# - id: black
# # It is recommended to specify the latest version of Python
# # supported by your project here, or alternatively use
# # pre-commit's default_language_version, see
# # https://pre-commit.com/#top_level-default_language_version
# language_version: python3.12
# exclude: "archived/"


# Below is linter (to be turned on after pyproject.toml update)
# - repo: https://github.com/astral-sh/ruff-pre-commit
# # Ruff version.
# rev: v0.8.3
# hooks:
# # Run the linter.
# - id: ruff
# exclude: "archived/"
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ sphinx:
python:
install:
- requirements: requirements.txt
- requirements: doc/requirements.txt
- requirements: doc/requirements.txt
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


<table border="0">
<tr>
<td rowspan="2"><img src="./graphics/DRAGONS-Iconblue.png" width="100" height="100"></td>
Expand All @@ -11,18 +9,19 @@
</table>

# Current Status
**The stable version is v3.2.2.**

**The stable version is v3.2.2.**

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13821517.svg)](https://doi.org/10.5281/zenodo.13821517) DRAGONS is distributed as a conda package, *dragons*, and it is
included in the conda *gemini* stack.
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13821517.svg)](https://doi.org/10.5281/zenodo.13821517)
DRAGONS is distributed as a conda package, *dragons*, and it is included in the
conda *gemini* stack.

Version 3.2 is recommend for the reduction of **imaging** data from Gemini's
current facility instruments: GMOS, NIRI, Flamingos-2, and GSAOI, for the
reduction of GMOS longslit spectroscopy data, and the reduction of GHOST data.

To reduce other types of Gemini spectroscopy data, please continue to use
the [Gemini IRAF package](https://www.gemini.edu/observing/phase-iii/reducing-data/gemini-iraf-data-reduction-software).
To reduce other types of Gemini spectroscopy data, please continue to use the
[Gemini IRAF package](https://www.gemini.edu/observing/phase-iii/reducing-data/gemini-iraf-data-reduction-software).

To install DRAGONS:

Expand All @@ -37,49 +36,49 @@ $ conda config --add channels conda-forge
$ conda config --add channels http://astroconda.gemini.edu/public
```

A list of changes since 3.1 can be found in the
[Change Logs](https://dragons.readthedocs.io/en/v3.2.0/changes.html).

A list of changes since 3.1 can be found in the [Change Logs](https://dragons.readthedocs.io/en/v3.2.0/changes.html).
______________________________________________________________________

---
# What is DRAGONS
DRAGONS is a platform for the reduction and processing of astronomical data.
The DRAGONS meta-package includes an infrastructure for automation of the
processes and algorithms for processing of astronomical data, with focus on the
reduction of Gemini data.

DRAGONS is a platform for the reduction and processing of astronomical data. The
DRAGONS meta-package includes an infrastructure for automation of the processes
and algorithms for processing of astronomical data, with focus on the reduction
of Gemini data.

---
______________________________________________________________________

# Documentation

Documentation on DRAGONS v3.2 is available on "readthedocs" at:

* https://dragons.readthedocs.io/en/v3.2.2/
- https://dragons.readthedocs.io/en/v3.2.2/

There your will find manuals for Astrodata and the Recipe System, and hands-on
tutorials on reducing Gemini imaging data with DRAGONS.

Gemini users with imaging data to reduce should pick the tutorial discussing
the reduction of data from the appropriate instrument.
Gemini users with imaging data to reduce should pick the tutorial discussing the
reduction of data from the appropriate instrument.

Software developers should start with the Astrodata and Recipe System
manuals.
Software developers should start with the Astrodata and Recipe System manuals.

---
______________________________________________________________________

# Setting up a development environment

To run checkouts, first set up a development conda environment. This is what
we are using at this time for the `master` branch and the `release/3.2.x`
branches.
To run checkouts, first set up a development conda environment. This is what we
are using at this time for the `master` branch and the `release/3.2.x` branches.

```
$ conda create -n dgdev3.10_20240401 python=3.10 astropy=6 astroquery matplotlib numpy psutil pytest python-dateutil requests scikit-image scipy sextractor sqlalchemy ds9 gwcs specutils sphinx sphinx_rtd_theme bokeh holoviews cython future astroscrappy=1.1 fitsverify imexam
$ conda activate dgdev3.10_20240401
$ pip install git+https://github.com/GeminiDRSoftware/GeminiObsDB.git@release/1.0.x
$ pip install git+https://github.com/GeminiDRSoftware/GeminiCalMgr.git@release/1.1.x
```
Dependencies change all the time and can break the development environment
or cause problems when conda tries to find a solution for the dependencies.
This not guaranteed to work flawlessly, you might have to adjust version
requirements.

Dependencies change all the time and can break the development environment or
cause problems when conda tries to find a solution for the dependencies. This
not guaranteed to work flawlessly, you might have to adjust version
requirements.
Loading
Loading