-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/621 move paths into baseconfig #623
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
23103c3
Move path-variables to BaseConfig
ArBridgeman 0ed2830
Switch PROJECT_CONFIG.root with PROJECT_CONFIG.root_path
ArBridgeman 8845fa9
Switch PROJECT_CONFIG.doc with PROJECT_CONFIG.documentation_path
ArBridgeman 8140f46
Switch PROJECT_CONFIG.source with PROJECT_CONFIG.source_code_path
ArBridgeman 1704aa2
Switch remainder over to BaseConfig usage
ArBridgeman 9f49b8a
Fix tests by creating test_project_config
ArBridgeman 0fdb113
Remove unused and unneeded additional templates for noxfconfig and no…
ArBridgeman f71df38
Add factory to create PROJECT_CONFIG equivalent for tests
ArBridgeman 1aeb6c5
Fix a few more .root places to .root_path
ArBridgeman dc5a0dd
Fix .doc places to .documentation_path
ArBridgeman cc3d212
Fix .source places to .source_code_path
ArBridgeman c245ac8
Fix .version_file to .version_filepath
ArBridgeman abceb2c
Relock dependencies for urllib3
ArBridgeman e2e16eb
Bump other dependencies to latest
ArBridgeman b55266b
Fix incomplete import to include exasol.
ArBridgeman 22b9212
Add changelog entry
ArBridgeman dec4607
Update user guide
ArBridgeman b5c4da0
Make sonar_code_path to make more explicit
ArBridgeman f6c029a
Move and rename _documentation_test to correct directory structure
ArBridgeman 4b4f056
Simplify test
ArBridgeman b271483
Switch to testing nox session
ArBridgeman cedec12
Add test for link check nox session
ArBridgeman 94063b2
Fix broken links
ArBridgeman 03e88bc
Add test for default config check
ArBridgeman 582e1ee
Add unit tests for tests:unit and tests:integration
ArBridgeman 9e67764
Remove unused code
ArBridgeman f4eb816
Merge branch 'main' into feature/621_move_paths_into_baseconfig
ArBridgeman 618a644
Add explicit information in the Summary of the unreleased.md
ArBridgeman c76203e
Merge branch 'main' into feature/621_move_paths_into_baseconfig
ArBridgeman 8c82930
Update unreleased file as no longer need a class Config
ArBridgeman d185326
Update tests as in this branch BaseConfig has 2 required values, so w…
ArBridgeman 4e73b31
Switch Config to BaseConfig for type & fix minor typos
ArBridgeman 4c0ea95
Prepare release 4.0.0
ArBridgeman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # 4.0.0 - 2025-12-09 | ||
|
|
||
| ## Summary | ||
|
|
||
| This major release removes `project:fix` and `project:format` | ||
| and replaces them with `format:fix` and `format:check`. | ||
|
|
||
| The `BaseConfig` has been extended to handle the commonly provided paths: | ||
| * `root` is now `root_path` | ||
| * `source` is now covered by `project_name` and `source_code_path`, which uses `root_path` and `project_name` | ||
| * `doc` is now `documentation_path` | ||
| * `version_file` is now `version_filepath` | ||
|
|
||
| If your project was previously defining these values, your **before** would look like: | ||
|
|
||
| ```python | ||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
| from typing import Iterable | ||
|
|
||
| from exasol.toolbox.config import BaseConfig | ||
|
|
||
|
|
||
| class Config(BaseConfig): | ||
| root: Path = Path(__file__).parent | ||
| doc: Path = Path(__file__).parent / "doc" | ||
| source: Path = Path("exasol/{{cookiecutter.package_name}}") | ||
| version_file: Path = ( | ||
| Path(__file__).parent | ||
| / "exasol" | ||
| / "{{cookiecutter.package_name}}" | ||
| / "version.py" | ||
| ) | ||
| plugins: Iterable[object] = () | ||
|
|
||
| PROJECT_CONFIG = Config() | ||
| ``` | ||
|
|
||
| With this major release, you **should modify** your project's `noxconfig.py` to look like: | ||
| ```python | ||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| from exasol.toolbox.config import BaseConfig | ||
|
|
||
| """ | ||
| A class `Config` only needs to be defined if: | ||
| - you have custom attributes to pass to your project-defined nox sessions | ||
| - you need to override a convention in the PTB. | ||
|
|
||
| These values do NOT need to be defined if your project follows the convention | ||
| expected from the PTB: | ||
| - documentation_path | ||
| - source_code_path | ||
| - version_filepath | ||
|
|
||
| If your values differ, you can override these properties with the needed values when | ||
| you define `class Config(BaseConfig)`. We highly recommend that you create an issue | ||
| to remove this override in the future by aligning your project's structure with | ||
| that expected by the PTB. | ||
|
|
||
| If you have additional Paths that used one of these values (i.e. `root_path`), then | ||
| you can define your own property in `class Config(BaseConfig)`, which accesses the | ||
| class values | ||
| """ | ||
| class Config(BaseConfig): | ||
| custom_field: str = "custom_field" | ||
|
|
||
| # For most projects, the PROJECT_CONFIG would look like: | ||
| PROJECT_CONFIG = BaseConfig( | ||
| project_name="{{cookiecutter.package_name}}", | ||
| root_path=Path(__file__).parent, | ||
| ) | ||
| ``` | ||
|
|
||
| ## Refactoring | ||
|
|
||
| * #606: Renamed nox session `project:fix` more aptly to `format:fix` and `project:format` to `format:check` | ||
| * #604: Updated `BaseConfig.exasol_versions` to `("7.1.30", "8.29.13", "2025.1.8")` | ||
|
|
||
| ## Feature | ||
|
|
||
| * #614: Replaced `path_filters` with `BaseConfig.add_to_excluded_python_paths` and `BaseConfig.excluded_python_paths` | ||
| * #626: Replaced `plugins` with `BaseConfig.plugins_for_nox_sessions` | ||
| * #621: Moved path specifications into `BaseConfig` | ||
| * `root` is now `root_path`, which must be specified by the project | ||
| * `source` is now covered by `project_name`, which must be specified by the project, | ||
| and `source_code_path`, which uses `root_path` and `project_name` | ||
| * `doc` is now `documentation_path` and no longer needs to be specified | ||
| * `version_file` is now `version_filepath` and no longer needs to be specified | ||
|
|
||
| ## Dependency Updates | ||
|
|
||
| ### `main` | ||
| * Updated dependency `bandit:1.9.1` to `1.9.2` | ||
| * Updated dependency `mypy:1.18.2` to `1.19.0` | ||
| * Updated dependency `pre-commit:4.4.0` to `4.5.0` | ||
| * Updated dependency `pydantic:2.12.4` to `2.12.5` | ||
| * Updated dependency `pylint:4.0.3` to `4.0.4` | ||
| * Updated dependency `ruff:0.14.5` to `0.14.8` |
This file contains hidden or 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,14 +1 @@ | ||
| # Unreleased | ||
|
|
||
| This major release removes `project:fix` and `project:format` | ||
| and replaces them with `format:fix` and `format:check`. | ||
|
|
||
| ## Refactoring | ||
|
|
||
| * #606: Renamed nox session `project:fix` more aptly to `format:fix` and `project:format` to `format:check` | ||
| * #604: Updated `BaseConfig.exasol_versions` to `("7.1.30", "8.29.13", "2025.1.8")` | ||
|
|
||
| ## Feature | ||
|
|
||
| * #614: Replaced `path_filters` with `BaseConfig.add_to_excluded_python_paths` and `BaseConfig.excluded_python_paths` | ||
| * #626: Replaced `plugins` with `BaseConfig.plugins_for_nox_sessions` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.