-
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 #13 from lsst-sqre/tickets/DM-33981
[DM-33981] Update build system and packaging
- Loading branch information
Showing
38 changed files
with
1,348 additions
and
815 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,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,123 @@ | ||
name: Python CI | ||
|
||
"on": | ||
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/**" | ||
- "renovate/**" | ||
- "tickets/**" | ||
- "u/**" | ||
tags: | ||
- "*" | ||
pull_request: {} | ||
schedule: | ||
- cron: "0 12 * * 1" | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
- name: Install tox | ||
run: pip install tox tox-docker | ||
|
||
- name: Cache tox environments | ||
id: cache-tox | ||
uses: actions/cache@v2 | ||
with: | ||
path: .tox | ||
# setup.cfg and pyproject.toml have versioning info that would | ||
# impact the tox environment. | ||
key: tox-${{ matrix.python }}-${{ hashFiles('pyproject.toml', 'setup.cfg') }} | ||
|
||
- name: Run tox | ||
run: tox -e py,typing | ||
|
||
docs: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Graphviz | ||
run: sudo apt-get install graphviz | ||
|
||
- name: Install tox and LTD Conveyor | ||
run: pip install tox ltd-conveyor | ||
|
||
- name: Run tox | ||
run: tox -e docs | ||
|
||
# Only attempt documentation uploads for tagged releases and pull | ||
# requests from ticket branches in the same repository. This avoids | ||
# version clutter in the docs and failures when a PR doesn't have access | ||
# to secrets. | ||
- name: Upload to LSST the Docs | ||
env: | ||
LTD_USERNAME: ${{ secrets.LTD_USERNAME }} | ||
LTD_PASSWORD: ${{ secrets.LTD_PASSWORD }} | ||
run: ltd upload --product templatekit --gh --dir docs/_build/html | ||
if: > | ||
github.event_name != 'schedule' | ||
&& (github.event_name != 'pull_request' | ||
|| startsWith(github.head_ref, 'tickets/')) | ||
pypi: | ||
|
||
runs-on: ubuntu-latest | ||
needs: [test, docs] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel | ||
- name: Build | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Upload | ||
uses: pypa/[email protected] | ||
env: | ||
user: "__token__" | ||
password: ${{ secrets.PYPI_SQRE_ADMIN }} |
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,23 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-yaml | ||
- id: check-toml | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.0 | ||
hooks: | ||
- id: isort | ||
additional_dependencies: | ||
- toml | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.1.0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
.PHONY: init | ||
init: | ||
pip install --upgrade pip tox pre-commit | ||
pip install --upgrade -e ".[dev]" | ||
pre-commit install |
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
Oops, something went wrong.