Skip to content

Commit

Permalink
Add name and version of project into 'pyproject.toml'
Browse files Browse the repository at this point in the history
  • Loading branch information
Taragolis committed Sep 2, 2023
1 parent c055e1d commit 460b196
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ repos:
- --ignore-words=docs/spelling_wordlist.txt
- --skip=airflow/providers/*/*.rst,airflow/www/*.log,docs/*/commits.rst,docs/apache-airflow/tutorial/pipeline_example.csv,*.min.js,*.lock,INTHEWILD.md
- --exclude-file=.codespellignorelines
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.14
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
- repo: local
# Note that this is the 2nd "local" repo group in the .pre-commit-config.yaml file. This is because
# we try to minimise the number of passes that must happen in order to apply some of the changes
Expand Down Expand Up @@ -424,6 +429,12 @@ repos:
language: python
files: ^docs
pass_filenames: false
- id: update-project-version
name: Update project version to the latest version
entry: ./scripts/ci/pre_commit/pre_commit_update_versions.py
language: python
files: ^pyproject.toml
pass_filenames: false
- id: check-pydevd-left-in-code
language: pygrep
name: Check for pydevd debug statements accidentally left
Expand Down
4 changes: 4 additions & 0 deletions STATIC_CODE_CHECKS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ require Breeze Docker image to be built locally.
+-----------------------------------------------------------+--------------------------------------------------------------+---------+
| update-migration-references | Update migration ref doc | * |
+-----------------------------------------------------------+--------------------------------------------------------------+---------+
| update-project-version | Update project version to the latest version | |
+-----------------------------------------------------------+--------------------------------------------------------------+---------+
| update-providers-dependencies | Update cross-dependencies for providers packages | |
+-----------------------------------------------------------+--------------------------------------------------------------+---------+
| update-spelling-wordlist-to-be-sorted | Sort alphabetically and uniquify spelling_wordlist.txt | |
Expand All @@ -359,6 +361,8 @@ require Breeze Docker image to be built locally.
+-----------------------------------------------------------+--------------------------------------------------------------+---------+
| update-version | Update version to the latest version in the documentation | |
+-----------------------------------------------------------+--------------------------------------------------------------+---------+
| validate-pyproject | Validate pyproject.toml | |
+-----------------------------------------------------------+--------------------------------------------------------------+---------+
| yamllint | Check YAML files with yamllint | |
+-----------------------------------------------------------+--------------------------------------------------------------+---------+

Expand Down
2 changes: 2 additions & 0 deletions dev/breeze/src/airflow_breeze/pre_commit_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@
"update-installed-providers-to-be-sorted",
"update-local-yml-file",
"update-migration-references",
"update-project-version",
"update-providers-dependencies",
"update-spelling-wordlist-to-be-sorted",
"update-supported-versions",
"update-vendored-in-k8s-json-schema",
"update-version",
"validate-pyproject",
"yamllint",
]
2 changes: 1 addition & 1 deletion images/breeze/output-commands-hash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ setup:version:be116d90a21c2afe01087f7609774e1e
setup:fd391bab5277ad3aca65987a84144d51
shell:1462cde6f7e11a73cb42d4eec93c598e
start-airflow:d4815dea2cfc0af7038697c1d9a13996
static-checks:d643498c1537236f20c475c0036f1a30
static-checks:603a7e3c6f1eee2489db045ca2ea826c
testing:docker-compose-tests:a4dfe7dadbe3e95fdf2b8d2107f7e208
testing:helm-tests:0669be17b744ba057adbf38681bd8e68
testing:integration-tests:e745af9dd595adaa6f17ef02fbaae3b5
Expand Down
4 changes: 2 additions & 2 deletions images/breeze/output_static-checks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ requires = ['setuptools==67.2.0']
build-backend = "setuptools.build_meta"

[project]
name = "apache-airflow"
version = "2.8.0.dev0" # sentinel comment for project version
requires-python = ">=3.8"

[tool.ruff]
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/pre_commit/pre_commit_update_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def update_version(pattern: re.Pattern, v: str, file_path: Path):
r"(apache\/airflow:)[^-]*(\-)": "docs/docker-stack/entrypoint.rst",
r"(`apache/airflow:(?:slim-)?)[0-9].*?((?:-pythonX.Y)?`)": "docs/docker-stack/README.md",
r"(\(Assuming Airflow version `).*(`\))": "docs/docker-stack/README.md",
r"""(^version\s?=\s?[\"']).*([\"']\s?#\s?sentinel.*$)""": "pyproject.toml",
}


Expand Down

0 comments on commit 460b196

Please sign in to comment.