This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
-
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.
- Loading branch information
Showing
12 changed files
with
712 additions
and
712 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 |
---|---|---|
@@ -1 +1 @@ | ||
* text=lf | ||
* text=lf |
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: Release Please | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
with: | ||
# this assumes that you have created a personal access token | ||
# (PAT) and configured it as a GitHub action secret named | ||
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). | ||
token: ${{ secrets.RELEASE_PLEASE_PAT }} | ||
# this is a built-in strategy in release-please, see "Action Inputs" | ||
# for more options | ||
release-type: python | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: Release Please | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
with: | ||
# this assumes that you have created a personal access token | ||
# (PAT) and configured it as a GitHub action secret named | ||
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). | ||
token: ${{ secrets.RELEASE_PLEASE_PAT }} | ||
# this is a built-in strategy in release-please, see "Action Inputs" | ||
# for more options | ||
release-type: python |
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 |
---|---|---|
@@ -1,41 +1,41 @@ | ||
name: Ruff | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
name: Ruff | ||
|
||
steps: | ||
- name: Check-out repository | ||
uses: actions/checkout@v4.1.4 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Export dependencies | ||
run: poetry export -f requirements.txt --output requirements.txt --without-hashes | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
**/requirements*.txt | ||
- name: Install Dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- uses: chartboost/ruff-action@v1 | ||
name: Ruff Lint | ||
|
||
- uses: chartboost/ruff-action@v1 | ||
name: Ruff Format Check | ||
with: | ||
args: 'format --check' | ||
name: Ruff | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
name: Ruff | ||
|
||
steps: | ||
- name: Check-out repository | ||
uses: actions/checkout@v4.1.4 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Export dependencies | ||
run: poetry export -f requirements.txt --output requirements.txt --without-hashes | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
**/requirements*.txt | ||
- name: Install Dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- uses: chartboost/ruff-action@v1 | ||
name: Ruff Lint | ||
|
||
- uses: chartboost/ruff-action@v1 | ||
name: Ruff Format Check | ||
with: | ||
args: 'format --check' |
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 |
---|---|---|
@@ -1,54 +1,54 @@ | ||
# Development guide | ||
|
||
## Project structure | ||
|
||
This python project is built using the [poetry](https://python-poetry.org/) dependency manager. | ||
All the project dependencies are defined in the `pyproject.toml` file. The code resides in the `drumpy` folder. | ||
|
||
Some tools are used to maintain the code quality and to automate the development process. These tools are defined in the `pyproject.toml` file as well. | ||
These are: | ||
- [ruff](https://docs.astral.sh/ruff/) for code formatting and linting. With optionally the ruff-lsp extension for providing integration in the editor. | ||
- [pyright](https://github.com/microsoft/pyright) for static type checking. | ||
- [deptry](https://deptry.com/) to check for issues with dependencies, such as unused or missing dependencies. | ||
- [pre-commit](https://pre-commit.com/) to run the above tools before committing changes. | ||
|
||
## GitHub Actions | ||
|
||
The project uses GitHub actions to automate the release and deployment process. The workflow files are defined in the `.github/workflows` folder. | ||
|
||
### Release Please (https://github.com/googleapis/release-please) | ||
|
||
The [release-please-action](https://github.com/marketplace/actions/release-please-action) is used to automate the release process. It creates a pull request with the changes in the `CHANGELOG.md` file and the version bump in the `pyproject.toml` file. | ||
Based on the commit messages, it determines the type of change and the version bump. | ||
|
||
### Docker build and push | ||
|
||
The `docker.yml` workflow file builds the docker image and pushes it to the GitHub Container Registry. | ||
|
||
### Nuitka build | ||
|
||
The `nuitka.yml` workflow file builds the application using [Nuitka](https://nuitka.net/) and uploads the binaries as an artifact. | ||
Note that the nuitka build action installs the dependencies using pip and requires the `requirements.txt` file to be present. | ||
This file is generated using the `poetry export` command. | ||
```shell | ||
poetry export -f requirements.txt --output requirements.txt --without-hashes | ||
``` | ||
This command is executed in the `nuitka.yml` workflow file, so it is not necessary to run it manually. | ||
It is provided by the [Poetry Export Plugin](https://github.com/python-poetry/poetry-plugin-export). | ||
|
||
|
||
#### Building locally | ||
|
||
For testing and debugging purposes, it is possible to build the application locally using Nuitka. | ||
You can find the required nuitka command in the [build_exe.nu](build_exe.nu) file. Or you can run the following command: | ||
```shell | ||
poetry run python -m nuitka | ||
--include-plugin-directory=.venv/Lib/site-packages/pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/*.*=pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/translations/*=pygame_gui/data/translations/ | ||
--include-data-files=./*.task=./ | ||
--include-data-dir=./DrumSamples=./DrumSamples | ||
--enable-console | ||
--enable-plugin=no-qt | ||
--standalone ./drumpy/cli.py | ||
``` | ||
# Development guide | ||
|
||
## Project structure | ||
|
||
This python project is built using the [poetry](https://python-poetry.org/) dependency manager. | ||
All the project dependencies are defined in the `pyproject.toml` file. The code resides in the `drumpy` folder. | ||
|
||
Some tools are used to maintain the code quality and to automate the development process. These tools are defined in the `pyproject.toml` file as well. | ||
These are: | ||
- [ruff](https://docs.astral.sh/ruff/) for code formatting and linting. With optionally the ruff-lsp extension for providing integration in the editor. | ||
- [pyright](https://github.com/microsoft/pyright) for static type checking. | ||
- [deptry](https://deptry.com/) to check for issues with dependencies, such as unused or missing dependencies. | ||
- [pre-commit](https://pre-commit.com/) to run the above tools before committing changes. | ||
|
||
## GitHub Actions | ||
|
||
The project uses GitHub actions to automate the release and deployment process. The workflow files are defined in the `.github/workflows` folder. | ||
|
||
### Release Please (https://github.com/googleapis/release-please) | ||
|
||
The [release-please-action](https://github.com/marketplace/actions/release-please-action) is used to automate the release process. It creates a pull request with the changes in the `CHANGELOG.md` file and the version bump in the `pyproject.toml` file. | ||
Based on the commit messages, it determines the type of change and the version bump. | ||
|
||
### Docker build and push | ||
|
||
The `docker.yml` workflow file builds the docker image and pushes it to the GitHub Container Registry. | ||
|
||
### Nuitka build | ||
|
||
The `nuitka.yml` workflow file builds the application using [Nuitka](https://nuitka.net/) and uploads the binaries as an artifact. | ||
Note that the nuitka build action installs the dependencies using pip and requires the `requirements.txt` file to be present. | ||
This file is generated using the `poetry export` command. | ||
```shell | ||
poetry export -f requirements.txt --output requirements.txt --without-hashes | ||
``` | ||
This command is executed in the `nuitka.yml` workflow file, so it is not necessary to run it manually. | ||
It is provided by the [Poetry Export Plugin](https://github.com/python-poetry/poetry-plugin-export). | ||
|
||
|
||
#### Building locally | ||
|
||
For testing and debugging purposes, it is possible to build the application locally using Nuitka. | ||
You can find the required nuitka command in the [build_exe.nu](build_exe.nu) file. Or you can run the following command: | ||
```shell | ||
poetry run python -m nuitka | ||
--include-plugin-directory=.venv/Lib/site-packages/pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/*.*=pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/translations/*=pygame_gui/data/translations/ | ||
--include-data-files=./*.task=./ | ||
--include-data-dir=./DrumSamples=./DrumSamples | ||
--enable-console | ||
--enable-plugin=no-qt | ||
--standalone ./drumpy/cli.py | ||
``` |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
(poetry run python -m nuitka | ||
--include-plugin-directory=.venv/Lib/site-packages/pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/*.*=pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/translations/*=pygame_gui/data/translations/ | ||
--include-data-dir=./resources=./resources | ||
--enable-console | ||
--enable-plugin=no-qt | ||
--standalone ./drumpy/cli.py | ||
) | ||
(poetry run python -m nuitka | ||
--include-plugin-directory=.venv/Lib/site-packages/pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/*.*=pygame_gui/data/ | ||
--include-data-files=.venv/Lib/site-packages/pygame_gui/data/translations/*=pygame_gui/data/translations/ | ||
--include-data-dir=./resources=./resources | ||
--enable-console | ||
--enable-plugin=no-qt | ||
--standalone ./drumpy/cli.py | ||
) |
Oops, something went wrong.