https://pantsbuild.org/ logo
h

helpful-jackal-12093

10/17/2021, 4:11 PM
Hi Guys I have a couple of questions: 1. Is it possible to use pex_binary with environment variables? 2. We have tests that need an environment variable only if they use a specific library (models django orm - they need the DJANGO_SETTINGS_MODULE), is it possible to pass the variable up the stack to a test? 3. it seems that
pants tailor
ignores fixtures/marks in pytest (
//:pytest-asyncio
if there’s a test that uses
@pytest.mark.asyncio
) , would it be possible detect this automatically 4. we have a
pyproject.toml
that has an
addopts
for example
addopts ="-p no:dash"
, pytest fails because it doesn’t recognize this, we needed to add
--
in the beginning of
addopts
, is this intended or a bug?
h

happy-kitchen-89482

10/17/2021, 6:17 PM
Hi! 1. Can you explain what you mean? If you build a pex in Pants and then run it outside of Pants, it's just a process that has access to its environment like any other. So I assume you're asking about something else? 2. One way to do that kind of thing is with
conftest.py
. There is an example here: https://github.com/pantsbuild/example-django/blob/main/helloworld/greet/conftest.py 3. You'd like
tailor
to add those dependencies automatically? Probably what we actually want is for dependency inference to understand marks, that would be a great feature! Could you open a ticket for it at https://github.com/pantsbuild/pants/issues? 4. Hmm, that might be a bug, can you file it at that same link? Thanks!
h

helpful-jackal-12093

10/19/2021, 10:16 AM
1. I see what you mean, I’ll try to get a specific example, but I think I understand you 2. Cool - will try it out. 3. https://github.com/pantsbuild/pants/issues/13290 4. https://github.com/pantsbuild/pants/issues/13291