agritheory / test_utils

Common Test Utilities and Fixtures for AgriTheory Projects
4 stars 4 forks source link

different formats between poetry and non-poetry pyproject.toml dependencies cause validate_python_dependencies error #76

Open HKuz opened 2 months ago

HKuz commented 2 months ago

I recently updated a version-15 branch for enet to use test_utils in .pre-commit-config.yaml and poetry in pyproject.toml. When I commit, I get a python dependency error that appears to be a parsing issue in get_versions in validate_python_dependencies.py. Both enet and frappe require requests ~= 2.32.0, but they're written slightly differently in the dependency sections:

# frappe's pyproject.toml dependencies:
dependencies = [
    ...,
    "requests~=2.32.0",
    ...
]
# enet's pyproject.toml dependencies:
[tool.poetry.dependencies]
...
requests = "~2.32.0"

pre-commit error (note that enet's version is blank):

validate_python_dependencies.............................................Failed
- hook id: validate_python_dependencies
- exit code: 1

Version mismatch for requests in:
frappe: ~2.32.0
enet:

Not sure how deep we want to go into matching versions since some of the syntax options represent an acceptable range (this SO answer explains the differences).