Skip to content

Commit

Permalink
Update package configuration for Breeze to pyproject.toml (apache#35652)
Browse files Browse the repository at this point in the history
This configuration allows breeze to be used in Python 3.12 which
misses disutils and moves to PEP-517 compliant way of installing
Python packages
  • Loading branch information
potiuk authored Nov 15, 2023
1 parent 3dbad4f commit 1e24a3c
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ repos:
name: Update Breeze README.md with config files hash
language: python
entry: ./scripts/ci/pre_commit/pre_commit_update_breeze_config_hash.py
files: ^dev/breeze/pyproject\.toml$|^dev/breeze/setup\.cfg$|^dev/breeze/setup\.py$|^dev/breeze/README\.md$
files: ^dev/breeze/pyproject\.toml$|^dev/breeze/README\.md$
pass_filenames: false
require_serial: true
- id: check-breeze-top-dependencies-limited
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ PLEASE DO NOT MODIFY THE HASH BELOW! IT IS AUTOMATICALLY UPDATED BY PRE-COMMIT.

---------------------------------------------------------------------------------------------------------

Package config hash: 7b512fa3a81a967c22fc4ccccf052a4c4dbcafd5c014adea775d45f0034d03e1c63d7d1e3df723e93724924ed3cfa92a5848c994c247dfd326c0a6300e282f88
Package config hash: 51d9c2ec8af90c2941d58cf28397e9972d31718bc5d74538eb0614ed9418310e7b1d14bb3ee11f4df6e8403390869838217dc641cdb1416a223b7cf69adf1b20

---------------------------------------------------------------------------------------------------------
78 changes: 78 additions & 0 deletions dev/breeze/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,68 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "apache-airflow-breeze"
version = "0.0.1"
description = "Apache Airflow Breeze development environment"
readme = "README.md"
authors = [
{name="Apache Software Foundation", email="[email protected]"},
]
maintainers = [
{name="Apache Software Foundation", email="[email protected]"},
]
keywords = [ "airflow", "development", "ci" ]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Framework :: Apache Airflow",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = "~=3.8"

dependencies = [
"black>=23.11.0",
"click>=8.1.7",
"filelock>=3.13.0",
"inputimeout>=1.0.4",
"jinja2>=3.1.0",
"packaging>=23.2",
"pendulum>=2.1.2,<3",
"pre-commit>=3.5.0",
"psutil>=5.9.6",
"pytest>=7.4.0",
"pytest-xdist>=3.3.1",
"pyyaml>=6.0.1",
"PyGithub>=2.1.1",
"requests>=2.30.0",
"rich>=13.6.0",
"rich-click>=1.7.1",
"gitpython>=3.1.40",
"semver>=3.0.2",
"tabulate>=0.9.0",
"twine>=4.0.2",
"wheel>=0.41.3",
"setuptools>=68.2.2",
"jsonschema>=4.19.1",
]

[project.scripts]
breeze = "airflow_breeze.breeze:main"

[tool.flit.module]
name = "airflow_breeze"

[tool.black]
line-length = 110
target-version = ['py37', 'py38', 'py39', 'py310']
Expand All @@ -37,3 +99,19 @@ testpaths = [
[tool.ruff]
extend = "../../pyproject.toml"
src = ["src"]


[tool.mypy]
ignore_missing_imports = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = false
pretty = true

[tool.isort]
line_length = 110
combine_as_imports = true
default_section = "THIRDPARTY"
known_first_party = "airflow,airflow_breeze,tests"
skip= "build,.tox,venv"
profile = "black"
105 changes: 0 additions & 105 deletions dev/breeze/setup.cfg

This file was deleted.

27 changes: 0 additions & 27 deletions dev/breeze/setup.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def get_package_setup_metadata_hash() -> str:
"""
Retrieves hash of setup.py and setup.cfg files.
Retrieves hash of pyproject.toml file.
This is used in order to determine if we need to upgrade Breeze, because some
setup files changed. Blake2b algorithm will not be flagged by security checkers
Expand All @@ -41,8 +41,6 @@ def get_package_setup_metadata_hash() -> str:
"""
try:
the_hash = hashlib.new("blake2b")
the_hash.update((BREEZE_SOURCES_ROOT / "setup.py").read_bytes())
the_hash.update((BREEZE_SOURCES_ROOT / "setup.cfg").read_bytes())
the_hash.update((BREEZE_SOURCES_ROOT / "pyproject.toml").read_bytes())
return the_hash.hexdigest()
except FileNotFoundError as e:
Expand Down

0 comments on commit 1e24a3c

Please sign in to comment.