-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from lsst-sqre/tickets/DM-42008
tickets/DM-42008: modernize lsst-rsp
- Loading branch information
Showing
35 changed files
with
613 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[flake8] | ||
max-line-length = 79 | ||
# E203: whitespace before :, flake8 disagrees with PEP-8 | ||
# W503: line break after binary operator, flake8 disagrees with PEP-8 | ||
ignore = E203, W503 | ||
exclude = | ||
docs/conf.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Please see the [Team Culture and Conduct Standards](https://developer.lsst.io/team/code-of-conduct.html) for LSST Data Management. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Thanks for contributing to lsst-rsp. | ||
|
||
## Support | ||
|
||
If you are a Rubin Observatory staff member, please reach out of us on Slack in the #dm-square channel or create a Jira ticket. | ||
|
||
If you are a community member, feel free to create a GitHub issue and we'll do our best to help you. | ||
|
||
## Pull requests | ||
|
||
Since lsst-rsp is built for the Vera C. Rubin Observatory and Legacy Survey of Space and Time, community contributions can only be accepted if they align with the Rubin Observatory's mission. | ||
For that reason, it's a good idea to propose changes with a new GitHub issue before investing time in making a pull request. | ||
|
||
* * * | ||
|
||
See also our [Code of Conduct](./CODE_OF_CONDUCT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,97 @@ | ||
name: CI | ||
name: Python CI | ||
|
||
"on": | ||
merge_group: {} | ||
pull_request: {} | ||
push: | ||
branches-ignore: | ||
# These should always correspond to pull requests, so ignore them for | ||
# the push trigger and let them be triggered by the pull_request | ||
# trigger, avoiding running the workflow twice. This is a minor | ||
# optimization so there's no need to ensure this is comprehensive. | ||
- "dependabot/**" | ||
- "gh-readonly-queue/**" | ||
- "renovate/**" | ||
- "tickets/**" | ||
- "u/**" | ||
tags: | ||
- "*" | ||
pull_request: {} | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
lint: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
test: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
strategy: | ||
matrix: | ||
python: | ||
- "3.10" | ||
- "3.11" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: Run tox | ||
uses: lsst-sqre/run-tox@v1 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
tox-envs: "py,typing" | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
- name: Install tox | ||
run: pip install tox | ||
test-packaging: | ||
|
||
name: Test packaging | ||
runs-on: ubuntu-latest | ||
|
||
- name: Cache tox environments | ||
id: cache-tox | ||
uses: actions/cache@v3 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: .tox | ||
key: tox-${{ matrix.python }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }} | ||
restore-keys: | | ||
tox-${{ matrix.python }}-${{ hashFiles('setup.cfg') }}- | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
- name: Build and publish | ||
uses: lsst-sqre/build-and-publish-to-pypi@v2 | ||
with: | ||
python-version: "3.11" | ||
upload: false | ||
|
||
- name: Run tox | ||
run: tox -e py,coverage-report,typing | ||
pypi: | ||
|
||
# This job requires set up: | ||
# 1. Set up a trusted publisher for PyPI | ||
# 2. Set up a "pypi" environment in the repository | ||
# See https://github.com/lsst-sqre/build-and-publish-to-pypi | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: [lint, test, test-packaging] | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/lsst-rsp | ||
permissions: | ||
id-token: write | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
cache-dependency-path: "setup.cfg" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel twine | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: "__token__" | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel --universal | ||
twine upload dist/* | ||
uses: lsst-sqre/build-and-publish-to-pypi@v2 | ||
with: | ||
python-version: "3.11" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Dependency Update | ||
|
||
"on": | ||
schedule: | ||
- cron: "0 12 * * 1" | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run neophile | ||
uses: lsst-sqre/run-neophile@v1 | ||
with: | ||
python-version: "3.11" | ||
mode: pr | ||
types: pre-commit | ||
app-id: ${{ secrets.NEOPHILE_APP_ID }} | ||
app-secret: ${{ secrets.NEOPHILE_PRIVATE_KEY }} | ||
|
||
- name: Report status | ||
if: always() | ||
uses: ravsamhq/notify-slack-action@v2 | ||
with: | ||
status: ${{ job.status }} | ||
notify_when: "failure" | ||
notification_title: "Periodic dependency update for {repo} failed" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This is a separate run of the Python test suite that doesn't cache the tox | ||
# environment and runs from a schedule. The purpose is to test compatibility | ||
# with the latest versions of dependencies. | ||
|
||
name: Periodic CI | ||
|
||
"on": | ||
schedule: | ||
- cron: "0 12 * * 1" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
strategy: | ||
matrix: | ||
python: | ||
- "3.11" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run tests in tox | ||
uses: lsst-sqre/run-tox@v1 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
tox-envs: "lint,typing,py" | ||
use-cache: false | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build docs in tox | ||
uses: lsst-sqre/run-tox@v1 | ||
with: | ||
python-version: "3.11" | ||
tox-envs: "docs,docs-linkcheck" | ||
use-cache: false | ||
|
||
test-packaging: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
- name: Build and publish | ||
uses: lsst-sqre/build-and-publish-to-pypi@v2 | ||
with: | ||
python-version: "3.11" | ||
upload: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Change log | ||
|
||
lsst-rsp is versioned with [semver](https://semver.org/). | ||
|
||
Find changes for the upcoming release in the project's [changelog.d directory](https://github.com/lsst-sqre/lsst-rsp/tree/main/changelog.d/). | ||
|
||
<!-- scriv-insert-here --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
.PHONY: help | ||
help: | ||
@echo "Make targets for lsst-rsp:" | ||
@echo "make clean - Remove generated files" | ||
@echo "make init - Set up dev environment (install pre-commit hooks)" | ||
@echo "make linkcheck - Check for broken links in documentation" | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf .tox | ||
rm -rf docs/_build | ||
rm -rf docs/api | ||
|
||
.PHONY: init | ||
init: | ||
pip install --upgrade pip pre-commit setuptools wheel | ||
pip install --upgrade --editable . | ||
rm -rf .tox | ||
pip install --upgrade tox | ||
pip install --upgrade pip tox pre-commit | ||
pip install --upgrade -e ".[dev]" | ||
pre-commit install | ||
rm -rf .tox | ||
|
||
# This is defined as a Makefile target instead of only a tox command because | ||
# if the command fails we want to cat output.txt, which contains the | ||
# actually useful linkcheck output. tox unfortunately doesn't support this | ||
# level of shell trickery after failed commands. | ||
.PHONY: linkcheck | ||
linkcheck: | ||
sphinx-build --keep-going -n -W -T -b linkcheck docs \ | ||
docs/_build/linkcheck \ | ||
|| (cat docs/_build/linkcheck/output.txt; exit 1) |
Oops, something went wrong.