-
Hello, I write this to a discussion, because I am not sure it is a bug. Most likely I do something wrong with the configuration. Here follows a brief description of my setup. If more information are needed, just let me know.
Here follows exempts from config files # project/pyproject.toml
[project]
# PEP 621 project metadata
# See https://www.python.org/dev/peps/pep-0621/
# *******
# omitted
# *******
requires-python = "==3.9.*"
dependencies = []
[project.optional-dependencies]
graphql = [
"aiodataloader>=0.2.1",
"aiohttp>=3.8.1",
"ariadne>=0.15.1",
"bson>=0.5.10",
"click>=7.1.2",
"flask==2.1.*",
"flatten-dict>=0.4.2",
"httpx>=0.23.0",
"jwt>=1.3.1",
"lark>=1.1.2",
"motor>=3.0.0",
"python-dateutil>=2.8.2",
"pyyaml>=6.0",
"starlette>=0.20.4",
"werkzeug",
]
rest = [
"connexion>=2.14.0",
"flask-cors>=3.0.10",
"flask-pymongo>=2.3.0",
"gunicorn>=20.1.0",
"markdown>=3.4.1",
"marshmallow>=3.17.0",
"pgpy>=0.5.4",
"prance>=0.21.8.0",
"prometheus-flask-exporter>=0.20.2",
"pygments>=2.12.0",
"pymongo>=4.2.0",
"semver>=2.13.0",
"sqlalchemy>=1.4.39",
]
[tool.pdm.dev-dependencies]
dev = [
"asynctest>=0.13.0",
"bandit>=1.7.4",
"black",
"coverage>=6.4",
"factory-boy>=3.2.1",
"flask-sqlalchemy>=2.5.1",
"iniconfig>=1.1.1",
"isort>=5.10.1",
"lazy-object-proxy>=1.7.1",
"locust>=1.5.1",
"mccabe>=0.7.0",
"mypy-extensions>=0.4.3",
"mypy>=0.960",
"packaging>=21.3",
"pyflakes>=2.4.0",
"pylint>=2.13.9",
"pyopenssl>=22.0.0",
"requests-mock>=1.9.3",
"requests>=2.27.1",
"safety>=1.10.3",
"yamllint>=1.26.3",
]
tox = [
"tox>=3.25.0",
"tox-pdm>=0.6.0",
]
pytest = [
"pytest-asyncio>=0.18.3",
"pytest-cov>=3.0.0",
"pytest-lazy-fixture>=0.6.3",
"pytest>=7.1.2",
]
[build-system]
requires = ["pdm-pep517>=1.0.0"]
build-backend = "pdm.pep517.api"
[tool.black]
skip-string-normalization = true As you can see, there are no primary dependencies, but there are two optional groups and also dev-groups. This is because of the nature of the project - we want to have overview, which dependencies belong to what services. On deployment, both optional groups are installed. The dependency graph is resolved without any issues and lock file is compiled and present (not including it). Here follows tox.ini: [vars]
# *** vars omitted here ***
[tox]
envlist = pyxis-test,
# *** many other omitted here ***
isolated_build = True
#passenv = LD_PRELOAD
skipsdist = True
[testenv]
basepython = python3.9
# setenv =
# PDM_IGNORE_SAVED_PYTHON="1"
[testenv:pyxis-test]
groups = graphql, rest, pytest
setenv =
# *** vars omitted here ***
commands = pytest -vv \
--ignore=tests/integration \
--ignore=scripts/ \
--ignore=schema/ \
--cov={[vars]PYXIS_MODULE} \
--cov-report html \
--cov-report term-missing \
--cov-fail-under 100 \
--seed 0 \
{posargs:{[vars]PYXIS_TESTS}}
As you can see from the
) Now, I have several (surely related) issues/questions. With tox-pdm, all primary deps should be installed automatically. I have none, so I need to include both optional groups manually within tox.ini
From the output, it should have installed all groups: "pyxis-test pdminstall: ['graphql, rest, pytest']", but from looking at the installed deps, deps from optional groups 'graphql' and 'rest' were not installed. One of the not installed dep in 'bson', which caused the error. But lots of some deps were installed - which are these? When I try to remove the optional groups 'graphql' and 'rest' from tox.ini file (
Less deps were installed. Makes sense, right? Less groups to install, less deps installed. But since the deps in the previous attempt were not deps from the group, what really changed?? Another attempt. I add a non existing group to the tox.ini, so that
No error regarding trying to install non existent group - ok. But more deps installed. In fact, the exact same set of deps as in first attempt (which was In overall, it seems to me, that there is some problem, if there are no primary deps in the project AND there are some optional groups AND there are dev groups. The behavior seems random to me. Please, I am open to any advice, any try-outs, etc.. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
groups =
graphql
rest
pytest |
Beta Was this translation helpful? Give feedback.
groups
is a line-list, so you need to specify groups each on its own line:groups = graphql rest pytest