diff options
| author | Árni Dagur <arni@dagur.eu> | 2023-03-03 00:20:10 +0100 |
|---|---|---|
| committer | Árni Dagur <arni@dagur.eu> | 2023-03-28 15:40:39 +0200 |
| commit | 873ff13bb0659a56cfec2e07b464a5f1bf8e722f (patch) | |
| tree | 3fefaf77a581e95d340b45d9c9e57e7bb4d44d49 | |
| parent | acd6f12d9e370e00de1ee6125c70a09cdcfae0ec (diff) | |
Duplicate package information for Poetry
| -rw-r--r-- | pyproject.toml | 15 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | [project] | 1 | [project] |
| 2 | name = "adblock" | 2 | name = "adblock" |
| 3 | version = "0.0.0" | 3 | version = "0.6.0" |
| 4 | description = "Brave's adblocking in Python" | 4 | description = "Brave's adblocking in Python" |
| 5 | requires-python = ">=3.7" | 5 | requires-python = ">=3.7" |
| 6 | authors = [ | 6 | authors = [{ name = "Árni Dagur", email = "arni@dagur.eu" }] |
| 7 | {email = "arni@dagur.eu"}, | ||
| 8 | {name = "Árni Dagur"} | ||
| 9 | ] | ||
| 10 | classifiers = [ | 7 | classifiers = [ |
| 11 | "Programming Language :: Python", | 8 | "Programming Language :: Python", |
| 12 | "Programming Language :: Rust", | 9 | "Programming Language :: Rust", |
| @@ -14,6 +11,12 @@ classifiers = [ | |||
| 14 | "License :: OSI Approved :: Apache Software License", | 11 | "License :: OSI Approved :: Apache Software License", |
| 15 | ] | 12 | ] |
| 16 | 13 | ||
| 14 | [tool.poetry] | ||
| 15 | name = "adblock" | ||
| 16 | version = "0.6.0" | ||
| 17 | description = "Brave's adblocking in Python" | ||
| 18 | authors = ["Árni Dagur <arni@dagur.eu>"] | ||
| 19 | |||
| 17 | [tool.poetry.dependencies] | 20 | [tool.poetry.dependencies] |
| 18 | python = "^3.6" | 21 | python = "^3.6" |
| 19 | 22 | ||
| @@ -23,5 +26,5 @@ pytest = "*" | |||
| 23 | toml = "*" | 26 | toml = "*" |
| 24 | 27 | ||
| 25 | [build-system] | 28 | [build-system] |
| 26 | requires = ["maturin>=0.12,<0.13"] | 29 | requires = ["maturin>=0.12"] |
| 27 | build-backend = "maturin" | 30 | 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(): | |||
| 16 | return parse_version(cargo_toml["package"]["version"]) | 16 | return parse_version(cargo_toml["package"]["version"]) |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | def get_version_values_pyproject(): | ||
| 20 | with open("pyproject.toml", encoding="utf-8") as f: | ||
| 21 | pyproject_toml = toml.loads(f.read()) | ||
| 22 | return [ | ||
| 23 | parse_version(pyproject_toml["project"]["version"]), | ||
| 24 | parse_version(pyproject_toml["tool"]["poetry"]["version"]), | ||
| 25 | ] | ||
| 26 | |||
| 27 | |||
| 19 | def get_version_value_changelog(): | 28 | def get_version_value_changelog(): |
| 20 | """ | 29 | """ |
| 21 | Try to get the names of all classes that we added to the Python module | 30 | Try to get the names of all classes that we added to the Python module |
| @@ -37,15 +46,18 @@ def get_version_value_changelog(): | |||
| 37 | 46 | ||
| 38 | def test_version_numbers_all_same(): | 47 | def test_version_numbers_all_same(): |
| 39 | """ | 48 | """ |
| 40 | Makes sure that `Cargo.toml` and `CHANGELOG.md` contain the same version | 49 | Makes sure that `pyproject.toml`, `Cargo.toml` and `CHANGELOG.md` contain |
| 41 | number as the one attached to the `adblock` module. | 50 | the same version number as the one attached to the `adblock` module. |
| 42 | """ | 51 | """ |
| 43 | cargo_version = get_version_value_cargo() | 52 | cargo_version = get_version_value_cargo() |
| 44 | changelog_version = get_version_value_changelog() | 53 | changelog_version = get_version_value_changelog() |
| 54 | pyproject_versions = get_version_values_pyproject() | ||
| 45 | module_version = parse_version(adblock.__version__) | 55 | module_version = parse_version(adblock.__version__) |
| 46 | 56 | ||
| 47 | assert cargo_version == module_version | 57 | assert cargo_version == module_version |
| 48 | assert module_version == changelog_version | 58 | assert module_version == changelog_version |
| 59 | assert changelog_version == pyproject_versions[0] | ||
| 60 | assert pyproject_versions[0] == pyproject_versions[1] | ||
| 49 | 61 | ||
| 50 | 62 | ||
| 51 | def get_current_python_version(): | 63 | def get_current_python_version(): |
