From 873ff13bb0659a56cfec2e07b464a5f1bf8e722f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Dagur?= Date: Fri, 3 Mar 2023 00:20:10 +0100 Subject: Duplicate package information for Poetry --- pyproject.toml | 15 +++++++++------ tests/test_metadata.py | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5655122..564e100 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,9 @@ [project] name = "adblock" -version = "0.0.0" +version = "0.6.0" description = "Brave's adblocking in Python" requires-python = ">=3.7" -authors = [ - {email = "arni@dagur.eu"}, - {name = "Árni Dagur"} -] +authors = [{ name = "Árni Dagur", email = "arni@dagur.eu" }] classifiers = [ "Programming Language :: Python", "Programming Language :: Rust", @@ -14,6 +11,12 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", ] +[tool.poetry] +name = "adblock" +version = "0.6.0" +description = "Brave's adblocking in Python" +authors = ["Árni Dagur "] + [tool.poetry.dependencies] python = "^3.6" @@ -23,5 +26,5 @@ pytest = "*" toml = "*" [build-system] -requires = ["maturin>=0.12,<0.13"] +requires = ["maturin>=0.12"] build-backend = "maturin" diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 62152f5..c719b4d 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -16,6 +16,15 @@ def get_version_value_cargo(): return parse_version(cargo_toml["package"]["version"]) +def get_version_values_pyproject(): + with open("pyproject.toml", encoding="utf-8") as f: + pyproject_toml = toml.loads(f.read()) + return [ + parse_version(pyproject_toml["project"]["version"]), + parse_version(pyproject_toml["tool"]["poetry"]["version"]), + ] + + def get_version_value_changelog(): """ Try to get the names of all classes that we added to the Python module @@ -37,15 +46,18 @@ def get_version_value_changelog(): def test_version_numbers_all_same(): """ - Makes sure that `Cargo.toml` and `CHANGELOG.md` contain the same version - number as the one attached to the `adblock` module. + Makes sure that `pyproject.toml`, `Cargo.toml` and `CHANGELOG.md` contain + the same version number as the one attached to the `adblock` module. """ cargo_version = get_version_value_cargo() changelog_version = get_version_value_changelog() + pyproject_versions = get_version_values_pyproject() module_version = parse_version(adblock.__version__) assert cargo_version == module_version assert module_version == changelog_version + assert changelog_version == pyproject_versions[0] + assert pyproject_versions[0] == pyproject_versions[1] def get_current_python_version(): -- cgit v1.2.3