-
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 #38 from TOMToolkit/fix/bring-project-up-to-date
tom_lt: Fix/bring project up to date
- Loading branch information
Showing
8 changed files
with
2,565 additions
and
58 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,41 @@ | ||
name: Create Github Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
- "*.*.*-alpha.*" | ||
- "*.*.*-beta.*" | ||
- "*.*.*-rc.*" | ||
|
||
jobs: | ||
run_tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
poetry install | ||
- name: Run tests | ||
run: echo "write tests!" | ||
|
||
create_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true |
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,29 @@ | ||
name: Release to PyPi | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish_to_pypi: | ||
runs-on: ubuntu-latest | ||
environment: release # configured in repo Settings/Environments; referenced in PyPI OIDC | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
poetry self add "poetry-dynamic-versioning[plugin]" | ||
- name: Build package with poetry | ||
run: | | ||
poetry build -f wheel | ||
poetry build -f sdist | ||
- name: Publish to PyPI with pypi-publish (trusted publishing) | ||
uses: pypa/[email protected] | ||
|
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,38 @@ | ||
name: run-tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
poetry install --with lint | ||
- name: Style Checks | ||
run: poetry run flake8 tom_* --exclude=*/migrations/* --max-line-length=120 | ||
|
||
run_tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
poetry install | ||
- name: Run tests | ||
run: poetry run python -m unittest discover -v |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[tool.poetry] | ||
name = "tom-lt" | ||
# this version is a placeholder: version supplied by poetry-dynamic-versioning | ||
version = "0.0.0" | ||
description = "TOM Toolkit Facility module for the Liverpool Telescope" | ||
authors = [ | ||
"Doug Arnold <[email protected]>", | ||
"David Collom <[email protected]>", | ||
"Lindy Lindstrom <[email protected]>"] | ||
license = "GPL-3.0-or-later" | ||
readme = "README.md" | ||
packages = [{include = "tom_lt"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.8.1,<3.12" | ||
tomtoolkit = ">=2.15" | ||
suds-py3 = "~1.4" | ||
lxml = "~5.2" | ||
|
||
[tool.poetry.group.lint.dependencies] | ||
flake8 = "~6.0" | ||
|
||
[tool.poetry-dynamic-versioning] | ||
enable = true | ||
vcs = "git" | ||
style = "pep440" | ||
# the default pattern regex makes the 'v' manditory | ||
# this pattern modifies the default regex in order to make the 'v' optional | ||
# ('v' becomes '[v]?' meaning a single v, [v], and ? means optional) | ||
pattern = "(?x)^[v]?((?P<epoch>\\d+)!)?(?P<base>\\d+(\\.\\d+)*)([-._]?((?P<stage>[a-zA-Z]+)[-._]?(?P<revision>\\d+)?))?(\\+(?P<tagged_metadata>.+))?$" | ||
|
||
# substitute version not only in pyproject.toml (which the config block above does) | ||
# but also the __version__.py file | ||
[tool.poetry-dynamic-versioning.substitution] | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"] | ||
build-backend = "poetry_dynamic_versioning.backend" | ||
# poetry_dynamic_versioning.backend is a thin wrapper around the standard build-backend = "poetry.core.masonry.api" |
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,2 @@ | ||
# placeholder for poetry-dynamic-versioning (see pyproject.toml) | ||
__version__ = "0.0.0" |
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