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

OPSIM-1079: Update pyproject.toml and workflows #364

Merged
merged 26 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
147f7ee
Add new doc workflow (for use after updating docs directory to Rubin …
rhiannonlynne Sep 27, 2023
5e8976a
Add ruff to test dependencies and drop flake8
rhiannonlynne Sep 27, 2023
7f14804
Drop six from requirements and use (we don't need to support python2 …
rhiannonlynne Sep 27, 2023
69d367e
Remove (now unnecessary) flake8 config in setup.cfg
rhiannonlynne Sep 27, 2023
299235d
Update pre-commit hooks
rhiannonlynne Sep 27, 2023
5603bbb
Update and shorten readme (creating README_dev with dev info on hyak/…
rhiannonlynne Sep 28, 2023
e1e4cb5
Removed incorrect (example_new_stacker doesn't follow API) and unused…
rhiannonlynne Sep 28, 2023
5cf8b76
Cleanup lss_obs_strategy in maf_contrib
rhiannonlynne Sep 28, 2023
a08b9ce
Readd transientascii sed metric; used for gw170817_det metric
rhiannonlynne Sep 28, 2023
5015e1d
Update requirements and pyproject.toml, along with README
rhiannonlynne Sep 28, 2023
4e9a5e2
Make sure ooephemerides works with pip pyoorb
rhiannonlynne Sep 28, 2023
807ec22
Update workflows
rhiannonlynne Sep 28, 2023
05b8e8f
Add blank setup.cfg because jenkins needs it
rhiannonlynne Sep 28, 2023
74cdda1
Ruff on rubin_sim.data
rhiannonlynne Sep 28, 2023
53cb618
Try adding isort to ruff workflow
rhiannonlynne Sep 28, 2023
31b6ee7
Ruff the batch files
rhiannonlynne Sep 28, 2023
8848142
Ruff maf.db
rhiannonlynne Sep 28, 2023
f9e99d7
More ruff
rhiannonlynne Sep 28, 2023
db4b83b
Recheck and fix ruff updates
rhiannonlynne Sep 29, 2023
ecee84c
black
rhiannonlynne Sep 29, 2023
7b855f8
Fixing some ruff over-enthusiastic changes (arrays need == not 'is')
rhiannonlynne Sep 29, 2023
6f296c4
remove get_colmap_dict from test cases
rhiannonlynne Sep 29, 2023
d85f5fa
Remove phot_prec_metrics
rhiannonlynne Sep 29, 2023
f2730f0
Remove testpaths from pytest (doesn't seem necessary)
rhiannonlynne Sep 29, 2023
3e2db6d
Yet another line length update to technical_metrics.py
rhiannonlynne Sep 29, 2023
634f852
Make ruff ignore "is" vs "==" comparisons to True.
rhiannonlynne Sep 29, 2023
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
Original file line number Diff line number Diff line change
@@ -1,59 +1,67 @@
name: Build and Push Documentation
name: Build and Upload Docs

on:
release:
types:
- created
"on":
push:
tags:
- "*"
branches:
- "main"
pull_request: {}
workflow_dispatch:

jobs:
Docs:
name: Build and push documentation
runs-on: "ubuntu-latest"
build_sphinx_docs:
name: Build and upload documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.10"
channels: conda-forge,defaults
python-version: "3.11"
channels: conda-forge
channel-priority: strict
show-channel-urls: true
- name: configure and install conda and requirements

- name: configure and install requirements and documenteer
shell: bash -l {0}
run: |
conda config --set always_yes yes
conda install --quiet --file=requirements.txt
conda install lsst-documenteer-pipelines
conda install --quiet pip
pip install "documenteer[guide]"

- name: install rubin_sim
shell: bash -l {0}
run: |
echo `pwd`
ls ${{ github.workspace }}
python -m pip install .

- name: download rubin_sim_data components needed to set up metrics for metricList
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}
rs_download_data --tdqm_disable -d 'maf,throughputs'
- name: conda list

- name: check conda and documenteer
shell: bash -l {0}
run: conda list
- name: build documentation
run: |
conda list

- name: build docs
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}
cd doc
python metric_list.py
make html
- name: Install LTD Conveyor
shell: bash -l {0}
run: |
python -m pip install ltd-conveyor
package-docs build

- name: upload documentation
shell: bash -l {0}
env:
LTD_PASSWORD: ${{ secrets.LTD_PASSWORD }}
LTD_USERNAME: ${{ secrets.LTD_USERNAME }}
run: |
ltd upload --gh --dir doc/_build/html --product rubin-sim
uses: lsst-sqre/ltd-upload@v1
with:
project: "rubin-sim"
dir: "docs/_build/html"
username: ${{ secrets.ltd_username }}
password: ${{ secrets.ltd_password }}

89 changes: 89 additions & 0 deletions .github/workflows/build_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build and Publish PyPI

on:
push:
branches:
- main
tags:
- "*"

jobs:
tests:
name: Check Tests (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
channels: conda-forge,defaults
miniforge-variant: Mambaforge
use-mamba: true
channel-priority: strict
show-channel-urls: true

- name: configure conda and install requirements
shell: bash -l {0}
run: |
mamba config --set always_yes yes
mamba install --quiet --file=requirements.txt
mamba install --quiet --file=test-requirements.txt

- name: install rubin_sim
shell: bash -l {0}
run: |
echo `pwd`
python -m pip install .

- name: conda list
shell: bash -l {0}
run: conda list

- name: run unit tests
shell: bash -l {0}
run: |
pytest -r a -v --cov=rubin_sim --cov=tests --cov-report=xml --cov-report=term --cov-branch

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
file: coverage.xml

pypi:
name: Build and upload to PyPI
runs-on: ubuntu-latest
needs: [tests]
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v4
with:
# Need to clone everything to embed the version.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"

- name: Install dependencies for build
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools build

- name: Build and create distribution
run: |
python -m build --skip-dependency-check

- name: Upload to lsst-sp PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.SP_PYPI_UPLOADS }}
24 changes: 24 additions & 0 deletions .github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Ruff and iSort
on:
# Trigger the workflow on push (to main) or pull request
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: isort/isort-action@v1
with:
requirements-files: "requirements.txt test-requirements.txt"
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run All Tests
name: Run All of the Tests

on:
push:
Expand All @@ -16,39 +16,50 @@ jobs:
fail-fast: True
matrix:
os: ["ubuntu-latest-8-cores"]
python-version: ["3.10"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
miniforge-variant: Mambaforge
use-mamba: true
channel-priority: strict
show-channel-urls: true

- name: configure conda and install requirements
shell: bash -l {0}
run: |
conda config --set always_yes yes
conda install --quiet --file=requirements.txt
conda install --quiet --file=test-requirements.txt
mamba config --set always_yes yes
mamba install --quiet --file=requirements.txt
mamba install --quiet --file=test-requirements.txt

- name: install rubin_sim
shell: bash -l {0}
run: |
echo `pwd`
ls ${{ github.workspace }}
python -m pip install .

- name: download rubin_sim_data components needed for unit tests
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
rs_download_data --force --tdqm_disable

- name: conda list
shell: bash -l {0}
run: conda list

- name: run tests
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
pytest
pytest -r a -v --cov=rubin_sim --cov=tests --cov-report=xml --cov-report=term --cov-branch

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
file: coverage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,54 +18,60 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.10"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
miniforge-variant: Mambaforge
use-mamba: true
channel-priority: strict
show-channel-urls: true

- name: configure conda and install requirements
shell: bash -l {0}
run: |
conda config --set always_yes yes
conda install --quiet --file=requirements.txt
conda install --quiet --file=test-requirements.txt
mamba config --set always_yes yes
mamba install --quiet --file=requirements.txt
mamba install --quiet --file=test-requirements.txt

- name: install rubin_sim
shell: bash -l {0}
run: |
echo `pwd`
ls ${{ github.workspace }}
python -m pip install .

- name: download rubin_sim_data components needed for unit tests
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
rs_download_data --tdqm_disable -d 'site_models,throughputs,skybrightness,skybrightness_pre'
rs_download_data --tdqm_disable -d tests --force

- name: conda list
shell: bash -l {0}
run: conda list

- name: run tests
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
pytest
pytest -r a -v

Docs:
name: Build and push documentation
needs: Tests
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.10"
python-version: "3.11"
channels: conda-forge,defaults
channel-priority: strict
show-channel-urls: true
Expand Down
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-toml
- repo: https://github.com/psf/black
rev: 23.7.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.11
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.278
hooks:
- id: ruff
Loading
Loading