Skip to content

Commit

Permalink
Add note about workflow to trigger workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkun committed Jul 4, 2024
1 parent 79451b6 commit 5fa84e9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/hatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
paths:
- 'hatch-demo/**'
defaults:
run:
working-directory: ./hatch-demo

jobs:
test:
Expand All @@ -15,6 +18,8 @@ jobs:
python-version: '3.12'
- name: Install Hatch
uses: pypa/hatch@install
- name: Build package
run: hatch build
- name: Lint
run: hatch run dev:check
- name: Run tests
Expand Down
14 changes: 12 additions & 2 deletions hatch-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,17 @@ run = "python src/hatch_demo/demo.py"
$ hatch run default:run
```

13. Add [hatch-based GH workflow](../.github/workflows/hatch.yml) to check linting and run tests

## Notes

* Not sure how to install the project so that it can called like `python -m hatch_demo`
* Not sure how to call the entrypoint scripts
* ~~Not sure how to install the project so that it can called like `python -m hatch_demo`~~
- You can run it from the `hatch` env like: `hatch run dev:python -m hatch_demo`
- You can install it from source and call it:
```bash
$ uv venv
$ uv pip install .
$ source .venv/bin/activate
$ python -m hatch_demo
```
* Not sure how to call the entrypoint scripts
5 changes: 4 additions & 1 deletion hatch-demo/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = []
dependencies = [
"polars",
"requests"
]

[project.urls]
Source = "https://github.com/davidkun/hatch-vs-poetry-vs-rye"
Expand Down
2 changes: 1 addition & 1 deletion hatch-demo/src/hatch_demo/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from demo import main
from .demo import main

if __name__ == "__main__":
main()

0 comments on commit 5fa84e9

Please sign in to comment.