Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Python client PoC #2

Merged
merged 5 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will build the python distribution and it will publish to Pypi
# This is going to be triggered on on every tag `v*`, e.g., `v0.13`.
# TODO: trigger tests once implemented, to ensure everything is working before publishing
name: Publish Horreum library

on:
push:
tags:
- v*

jobs:
test:
name: ${{ matrix.session }} ${{ matrix.python }}
Comment on lines +11 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where you are defining the matrix. Should that be here, or is it set up in a calling workflow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover

runs-on: ubuntu-latest
env:
FORCE_COLOR: "1"
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install development dependencies
run: pip install -r dev-requirements.txt
- name: Check version coherence
run: |
PROJECT_VERSION=$(poetry version | cut -d' ' -f2)
GIT_TAG=$(git describe --tags --match="v*")
if [[ "${GIT_TAG:1}" =~ $PROJECT_VERSION ]]; then
echo "::error title='$GIT_TAG tag does not match project version'::"
exit 1
fi
- name: Build python library
run: make generate && poetry build --ansi
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true
packages-dir: ./dist/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ Install all dev dependencies (consider using Python virtual environments):
pip install -r dev-requirements.txt
```

Generate source files
```bash
make generate
```

Comment on lines +50 to +54
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this change have been made to GET_STARTED.md as well? (Are you still sure you want to have this information in two places?? 🙃)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I am updating that in a followup PR, as I said in one of the previous comments, this is gonna be replaced by pip install <package> as soon as I can pusblish it on pypi. Therefore this is just a temporary duplication.

Build the library using `poetry`:
```bash
poetry build
Expand Down