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
10 changes: 8 additions & 2 deletions .github/actions/python-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ inputs:
required: true
default: "2.1.2"

working-directory:
description: 'Working directory to use'
required: true
default: "."

runs:

using: "composite"
steps:

- name: Setup Poetry (${{ inputs.poetry-version }})
run: pipx install poetry==${{ inputs.poetry-version }}
shell: bash
run: pipx install poetry==${{ inputs.poetry-version }}

- name: Setup Python (${{ inputs.python-version}})
uses: actions/setup-python@v5
Expand All @@ -29,5 +34,6 @@ runs:
cache: 'poetry'

- name: Poetry install
run: poetry install
working-directory: ${{ inputs.working-directory }}
shell: bash
run: poetry install
2 changes: 1 addition & 1 deletion .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: ./.github/actions/python-environment

- name: Download Artifacts
uses: actions/download-artifact@v4.2.1
uses: actions/download-artifact@v4.3.0
with:
path: ./artifacts

Expand Down
8 changes: 7 additions & 1 deletion doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

## ✨ Features

* [#378](https://github.com/exasol/python-toolbox/pull/378/files): Add Nox task to trigger a release
* [#362](https://github.com/exasol/python-toolbox/issues/362): Added Nox task to trigger a release
* [#406](https://github.com/exasol/python-toolbox/issues/406): Added `.poetry` to ignore list for formatting
* [#417](https://github.com/exasol/python-toolbox/issues/417): Added `working-directory` to `python-environment` action for a different `pyproject.toml` location

## Bugfixes

* [#401](https://github.com/exasol/python-toolbox/issues/401): Modified nox `docs:multiversion` to add `.nojekyll` file
14 changes: 7 additions & 7 deletions doc/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Use the following command to create a new project:

**2. Follow the interactive project setup prompt**

**3. Bootstrapp the development environment**
**3. Bootstrap the development environment**

Navigate to the directory of the newly created project:

Expand Down Expand Up @@ -127,7 +127,7 @@ Alternatively you can use the *noxconfig.py* file bellow and adjust the value of

4. Configure the tooling
++++++++++++++++++++++++
In order to make all standard task work properly you need add the configuration settings bellow to your *pyproject.toml*,
In order to make all standard task work properly, you need add the configuration settings below to your *pyproject.toml*,
and adjust the following settings to your project needs:

* coverage
Expand All @@ -145,8 +145,8 @@ and adjust the following settings to your project needs:
5. Make the toolbox tasks available
+++++++++++++++++++++++++++++++++++
In order to use the standard toolbox task via nox, just import them in your *noxfile.py*.
If you only need the standard tasks provided by the toolbox your *noxfile.py* is straight
forward and you just can use the example *noxfile.py* bellow.
If you only need the standard tasks provided by the toolbox, your *noxfile.py* is straight
forward, and you just can use the example *noxfile.py* below.

.. literalinclude:: ../../noxfile.py
:language: python3
Expand All @@ -161,8 +161,8 @@ forward and you just can use the example *noxfile.py* bellow.



6. Setup the pre-commit hooks [optional]
++++++++++++++++++++++++++++++++++++++++
6. Set up the pre-commit hooks [optional]
+++++++++++++++++++++++++++++++++++++++++

#. Add a :code:`.pre-commit-config.yaml` file to your project root

Expand All @@ -171,7 +171,7 @@ forward and you just can use the example *noxfile.py* bellow.
.. literalinclude:: ../../.pre-commit-config.yaml
:language: yaml

#. Enable pre commit hooks for your workspace
#. Enable pre-commit hooks for your workspace

.. code-block:: shell

Expand Down
1 change: 1 addition & 0 deletions exasol/toolbox/nox/_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def _build_multiversion_docs(session: nox.Session, config: Config) -> None:
f"{config.doc}",
DOCS_OUTPUT_DIR,
)
session.run("touch", f"{DOCS_OUTPUT_DIR}/.nojekyll")


def _git_diff_changes_main() -> int:
Expand Down
22 changes: 6 additions & 16 deletions exasol/toolbox/nox/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from noxconfig import PROJECT_CONFIG

DEFAULT_PATH_FILTERS = {"dist", ".eggs", "venv", ".poetry"}
DOCS_OUTPUT_DIR = ".html-documentation"


Expand All @@ -26,24 +27,13 @@ class Mode(Enum):


def python_files(project_root: Path) -> Iterable[Path]:
path_filters = tuple(["dist", ".eggs", "venv"] + list(PROJECT_CONFIG.path_filters))
return _python_files(project_root, path_filters)


def _python_files(
project_root: Path, path_filters: Iterable[str] = ("dist", ".eggs", "venv")
) -> Iterable[Path]:
"""Returns all relevant"""
return _deny_filter(project_root.glob("**/*.py"), deny_list=path_filters)


def _deny_filter(files: Iterable[Path], deny_list: Iterable[str]) -> Iterable[Path]:
"""
Adds a filter to remove unwanted paths containing python files from the iterator.
Returns iterable of python files after removing unwanted paths
"""
for entry in deny_list:
files = list(filter(lambda path: entry not in path.parts, files))
return files
deny_list = DEFAULT_PATH_FILTERS.union(set(PROJECT_CONFIG.path_filters))

files = project_root.glob("**/*.py")
return [path for path in files if not set(path.parts).intersection(deny_list)]


def _version(session: Session, mode: Mode, version_file: Path) -> None:
Expand Down
2 changes: 1 addition & 1 deletion exasol/toolbox/sphinx/multiversion/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import tempfile

GitRef = collections.namedtuple(
"VersionRef",
"GitRef",
[
"name",
"commit",
Expand Down
2 changes: 1 addition & 1 deletion exasol/toolbox/templates/github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
run: poetry run -- nox -s project:format

Tests:
name: Unit-Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
name: Unit-Tests (Python-${{ matrix.python-version }})
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ]
runs-on: ubuntu-24.04
env:
Expand Down
3 changes: 0 additions & 3 deletions noxconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class Config:
importlinter: Path = Path(__file__).parent / ".import_linter_config"
version_file: Path = Path(__file__).parent / "exasol" / "toolbox" / "version.py"
path_filters: Iterable[str] = (
"dist",
".eggs",
"venv",
"metrics-schema",
"project-template",
"idioms",
Expand Down
Loading