Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 11 additions & 10 deletions .github/workflows/build_dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ jobs:
with:
python-version: "3.10"

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.2"
python-version: "3.10"
enable-cache: true
- name: Install dependencies
run: |
python -m venv ./venv
. ./venv/bin/activate
python -m pip install --upgrade pip
pip install poetry
poetry install --with=dev --no-interaction --no-ansi
uv venv .venv
uv sync --locked --dev

- name: Gather new package version
id: version
Expand All @@ -46,14 +49,12 @@ jobs:

- name: Bump package version in pyproject.toml
run: |
. ./venv/bin/activate
poetry version ${{steps.version.outputs.new_tag}}
uv version ${{steps.version.outputs.new_tag}}

- name: Build dist
run: |
. ./venv/bin/activate
python -m build --sdist --wheel --no-isolation --outdir dist/ .
twine check dist/*
uv run python -m build --sdist --wheel --no-isolation --outdir dist/ .
uv run twine check dist/*

- name: Commit updated pyproject.toml
run: |
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ jobs:
with:
python-version: "3.10"

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.2"
python-version: "3.10"
enable-cache: true
- name: Install dependencies
run: |
python -m venv ./venv
. ./venv/bin/activate
python -m pip install --upgrade pip
pip install poetry
poetry install --with=docs --no-interaction --no-ansi
uv venv .venv
uv sync --locked --dev --group docs

- name: Build the sphinx docs
run: |
. ./venv/bin/activate
sphinx-apidoc -f -o ./sphinx/source ./src/<package_name>
make -C sphinx clean
python sphinx/clean_html_files.py
make -C sphinx html
uv run sphinx-apidoc -f -o ./sphinx/source ./src/<package_name>
uv run make -C sphinx clean
uv run python sphinx/clean_html_files.py
uv run make -C sphinx html
touch sphinx/build/html/.nojekyll

- name: Checkout gh-pages branch
Expand All @@ -42,9 +44,8 @@ jobs:

- name: Copy build files to docs folder
run: |
. ./venv/bin/activate
cp -a sphinx/build/html/. docs/
python sphinx/make_html_files_list.py
uv run python sphinx/make_html_files_list.py
rm -rf sphinx/build

- name: Commit to gh-pages branch
Expand Down
49 changes: 25 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,30 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.2"
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: |
python -m venv ./venv
. ./venv/bin/activate
python -m pip install --upgrade pip
pip install poetry
poetry install --with=dev --no-interaction --no-ansi
uv venv .venv
uv sync --locked --dev
- name: Test Linting
run: |
. ./venv/bin/activate
black src tests --check --diff
isort src tests --check-only --diff
uv run black src tests --check --diff
uv run isort src tests --check-only --diff
- name: Test Typing
run: |
. ./venv/bin/activate
mypy src tests
uv run mypy src tests
- name: Test Notebooks
run: |
. ./venv/bin/activate
pytest --nbmake notebooks -n=auto --nbmake-kernel=python3 --nbmake-timeout=600 # 10 minutes timeout
uv run pytest --nbmake notebooks -n=auto --nbmake-kernel=python3 --nbmake-timeout=600 # 10 minutes timeout

- name: Test Unittests with pytest
run: |
. ./venv/bin/activate
pytest tests -n=auto --cov=src --cov-report="xml:tests/.tmp/coverage.xml" --cov-report=term-missing --durations=10
uv run pytest tests -n=auto --cov=src --cov-report="xml:tests/.tmp/coverage.xml" --cov-report=term-missing --durations=10 --session-timeout=600

- name: Code Coverage
uses: orgoro/coverage@v3.2
Expand All @@ -63,10 +62,10 @@ jobs:
thresholdModified: 0.98

- name: Test Build
if: ${{ matrix.python-version == '3.10' }}
run: |
. ./venv/bin/activate
python -m build --sdist --wheel --no-isolation --outdir dist/ .
twine check dist/*
uv run python -m build --sdist --wheel --no-isolation --outdir dist/ .
uv run twine check dist/*

Run-tests-on-Windows:
name: Run tests on Windows-latest
Expand All @@ -81,14 +80,16 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.2"
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: |
python -m venv ./venv
. ./venv/Scripts/activate
python -m pip install --upgrade pip
pip install poetry
poetry install --with=dev --no-interaction --no-ansi
uv venv .venv
uv sync --locked --dev
- name: Test Unittests with pytest
run: |
. ./venv/Scripts/activate
pytest tests -n=auto
uv run pytest tests -n=auto --session-timeout=600
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,18 @@ The project is constituted by the following parts:
## Installation
### Development Dependencies

With `uv` installed, run the following commands to install the dependencies:
```bash
uv venv .venv
uv sync --dev
```

With `python` and `pip` installed, run the following commands to install the dependencies:
```bash
python -m venv .venv
source .venv/bin/activate
pip install poetry
python -m poetry install
pip install uv
python -m uv sync --dev
```

With `poetry` installed, run the following commands to install the dependencies:
Expand All @@ -76,6 +82,7 @@ source .venv/bin/activate
poetry install
```


## Scripting Usage
To run a single training, you can run the following command:
```bash
Expand Down
Binary file removed dist/pythontemplate-0.0.1-py3-none-any.whl
Binary file not shown.
Binary file removed dist/pythontemplate-0.0.1.tar.gz
Binary file not shown.
Loading