Skip to content

Commit

Permalink
move jobs to pyproject.toml using poethepoet (#1161)
Browse files Browse the repository at this point in the history
* updates

* update and reorder

* more cleanup

* speed up tests

* Revert "speed up tests"

This reverts commit 71253fd.

* remove Makefile too

* updates from review

* update windows docs
  • Loading branch information
shapiromatron authored Feb 18, 2025
1 parent 98c3878 commit 2396c49
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 384 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ jobs:
python-version: '3.12'
architecture: 'x64'
- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: install
run: |
Expand All @@ -48,10 +47,10 @@ jobs:
uv pip install --system -e client
- name: lint-py
run: |
make lint-py
poe lint-py
- name: lint-html
run: |
make lint-html
poe lint-html
- name: test
env:
DJANGO_DB_NAME: hawc
Expand All @@ -72,7 +71,7 @@ jobs:
run: |
sudo apt-get install -y cloc
echo "# Lines of code report" >> $GITHUB_STEP_SUMMARY
make loc >> $GITHUB_STEP_SUMMARY
poe loc >> $GITHUB_STEP_SUMMARY
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -113,7 +112,7 @@ jobs:

integration:
name: integration
needs: [backend, frontend]
needs: [frontend]
runs-on: ubuntu-22.04

services:
Expand Down Expand Up @@ -144,9 +143,8 @@ jobs:
python-version: '3.12'
architecture: 'x64'
- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Download webpack build
uses: actions/download-artifact@v4
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,24 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
cache: 'pip'

- name: install
run: python -m pip install -U pip wheel flit

- uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
- name: Install environment
run: |
uv pip install --system -e ".[dev,docs]"
uv pip install --system -e client
- name: Build client
run: cd client && flit build

run: cd client && poe build
- name: Publish package to PyPI
env:
PUBLISH_PYPI: ${{ secrets.PUBLISH_PYPI }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ hawc/gitcommit.json
hawc/main/settings/local.py
hawc/webpack-stats.json
package-lock.json
uv.lock

# folders
*.egg-info/
Expand All @@ -26,6 +27,7 @@ package-lock.json
.ipynb_checkpoints/
.mypy_cache/
.ruff_cache/
.venv/
.vscode/
/data/
docs/site
Expand Down
107 changes: 0 additions & 107 deletions Makefile

This file was deleted.

20 changes: 0 additions & 20 deletions bin/dev.sh

This file was deleted.

27 changes: 0 additions & 27 deletions client/Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@ Changes = "https://hawc.readthedocs.io/latest/client/#changelog"
[build-system]
requires = ["flit_core ~=3.9"]
build-backend = "flit_core.buildapi"

[tool.poe.tasks.build]
help = "Build package"
cmd = "uv build"

[tool.poe.tasks.upload-testpypi]
help = "Upload package to testpypi"
sequence = [
"build",
{cmd = "uv publish --publish-url=https://test.pypi.org/legacy/"},
]

[tool.poe.tasks.upload-pypi]
help = "Upload package to pypi"
sequence = [
"build",
{cmd = "uv publish"},
]
2 changes: 1 addition & 1 deletion docs/docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ other approaches for sharing with the deployment target:
```bash
# build containers (in the hawc development environment)
source venv/bin/activate
make build
poe build
docker-compose -f compose/dc-build.yml --project-directory . build
```

Expand Down
Loading

0 comments on commit 2396c49

Please sign in to comment.