From 83825a81f321a2eda28be1f34ce19fc3538e9da5 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 3 Jul 2025 13:01:10 -0700 Subject: [PATCH] Switch to uv build --- .github/workflows/release.yml | 5 ++++- HISTORY.rst | 6 ++++++ pyproject.toml | 24 +++++++++++++++--------- {geoip2 => src/geoip2}/__init__.py | 0 {geoip2 => src/geoip2}/_internal.py | 0 {geoip2 => src/geoip2}/database.py | 0 {geoip2 => src/geoip2}/errors.py | 0 {geoip2 => src/geoip2}/models.py | 0 {geoip2 => src/geoip2}/py.typed | 0 {geoip2 => src/geoip2}/records.py | 0 {geoip2 => src/geoip2}/types.py | 0 {geoip2 => src/geoip2}/webservice.py | 0 12 files changed, 25 insertions(+), 10 deletions(-) rename {geoip2 => src/geoip2}/__init__.py (100%) rename {geoip2 => src/geoip2}/_internal.py (100%) rename {geoip2 => src/geoip2}/database.py (100%) rename {geoip2 => src/geoip2}/errors.py (100%) rename {geoip2 => src/geoip2}/models.py (100%) rename {geoip2 => src/geoip2}/py.typed (100%) rename {geoip2 => src/geoip2}/records.py (100%) rename {geoip2 => src/geoip2}/types.py (100%) rename {geoip2 => src/geoip2}/webservice.py (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40f4d507..b16a92e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,8 +22,11 @@ jobs: submodules: true persist-credentials: false + - name: Install the latest version of uv + uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # 6.3.1 + - name: Build - run: pipx run build + run: uv build - uses: actions/upload-artifact@v4 with: diff --git a/HISTORY.rst b/HISTORY.rst index 6570043d..6d3c9764 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,12 @@ History ------- +5.2.0 +++++++++++++++++++ + +* Setuptools has been replaced with the uv build backend for building the + package. + 5.1.0 (2025-05-05) ++++++++++++++++++ diff --git a/pyproject.toml b/pyproject.toml index 0961762e..2e73112c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ dependencies = [ requires-python = ">=3.9" readme = "README.rst" license = "Apache-2.0" +license-files = ["LICENSE"] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", @@ -41,11 +42,19 @@ lint = [ ] [build-system] -requires = [ - "setuptools>=77.0.3", - "setuptools-scm", +requires = ["uv_build>=0.7.19,<0.8.0"] +build-backend = "uv_build" + +[tool.uv.build-backend] +source-include = [ + "HISTORY.rst", + "README.rst", + "LICENSE", + "docs/html", + "examples/*.py", + "tests/*.py", + "tests/data/test-data/*.mmdb" ] -build-backend = "setuptools.build_meta" [project.urls] Homepage = "https://www.maxmind.com/" @@ -81,12 +90,9 @@ ignore = [ [tool.ruff.lint.per-file-ignores] "docs/*" = ["ALL"] -"geoip2/{models,records}.py" = [ "D107", "PLR0913" ] +"src/geoip2/{models,records}.py" = [ "D107", "PLR0913" ] "tests/*" = ["ANN201", "D"] -[tool.setuptools.package-data] -geoip2 = ["py.typed"] - [tool.tox] env_list = [ "3.9", @@ -114,7 +120,7 @@ dependency_groups = [ "lint", ] commands = [ - ["mypy", "geoip2", "tests"], + ["mypy", "src", "tests"], ["ruff", "check"], ["ruff", "format", "--check", "--diff", "."], ] diff --git a/geoip2/__init__.py b/src/geoip2/__init__.py similarity index 100% rename from geoip2/__init__.py rename to src/geoip2/__init__.py diff --git a/geoip2/_internal.py b/src/geoip2/_internal.py similarity index 100% rename from geoip2/_internal.py rename to src/geoip2/_internal.py diff --git a/geoip2/database.py b/src/geoip2/database.py similarity index 100% rename from geoip2/database.py rename to src/geoip2/database.py diff --git a/geoip2/errors.py b/src/geoip2/errors.py similarity index 100% rename from geoip2/errors.py rename to src/geoip2/errors.py diff --git a/geoip2/models.py b/src/geoip2/models.py similarity index 100% rename from geoip2/models.py rename to src/geoip2/models.py diff --git a/geoip2/py.typed b/src/geoip2/py.typed similarity index 100% rename from geoip2/py.typed rename to src/geoip2/py.typed diff --git a/geoip2/records.py b/src/geoip2/records.py similarity index 100% rename from geoip2/records.py rename to src/geoip2/records.py diff --git a/geoip2/types.py b/src/geoip2/types.py similarity index 100% rename from geoip2/types.py rename to src/geoip2/types.py diff --git a/geoip2/webservice.py b/src/geoip2/webservice.py similarity index 100% rename from geoip2/webservice.py rename to src/geoip2/webservice.py