strong-toothbrush-37759
03/13/2022, 6:23 PMrequirements-dev.txt
) and actual dependencies (living in requirements.txt
). Do I understand correctly, that with Pants we don’t need that Schema anymore, since the BUILD or the dependency inference will package all needed dependencies within the PEX-File?
What is odd in the phase of migration right now is that tailor
is generating a conflicting python_requirements()
inside the src/BUILD
file right now. I understand from the documentation that I can make tailor
ignore the generation using ignore_adding_targets
, but is that really what I need to do in my situation?
Right now after running ./pants tailor
and linting with ./pants lint ::
I get the following error message:
❯ ./pants lint ::
19:19:05.32 [ERROR] 1 Exception encountered:
DuplicateNameError: A target already exists at 'src/BUILD' with name 'pytest' and target type 'python_requirement'. The 'python_requirement' target cannot use the same name.
So here’s the stupid question? Can I give the python_requirement target a name? The documentation has no field about this. 🙂curved-television-6568
03/13/2022, 6:32 PMcurved-television-6568
03/13/2022, 6:32 PMcurved-television-6568
03/13/2022, 6:33 PMstrong-toothbrush-37759
03/13/2022, 6:40 PMstrong-toothbrush-37759
03/13/2022, 6:43 PMpython_requirements()
target?curved-television-6568
03/13/2022, 6:46 PMpython_requirements(name=“..”)
ought to work..strong-toothbrush-37759
03/13/2022, 6:48 PMpex_binary(
name="manage",
entry_point="manage.py",
restartable=True,
)
python_requirements(
name="dev-requirements",
source="requirements-dev.txt",
)
python_sources()
python_requirements()
python_test_utils(
name="test_utils",
)
Here’s the error:
❯ ./pants lint ::
19:42:44.50 [ERROR] 1 Exception encountered:
MappingError: Failed to parse ./src/BUILD:
__call__() got an unexpected keyword argument 'name'
curved-television-6568
03/13/2022, 6:48 PMstrong-toothbrush-37759
03/13/2022, 6:48 PMstrong-toothbrush-37759
03/13/2022, 6:49 PMcurved-television-6568
03/13/2022, 6:50 PMstrong-toothbrush-37759
03/13/2022, 6:50 PM[GLOBAL]
pants_version = "2.9.0"
curved-television-6568
03/13/2022, 6:50 PMstrong-toothbrush-37759
03/13/2022, 6:52 PMpython_requirement
command. An immediate answer is not necessary at all 😄 I was just tinkering around with this and could finally clarify what I’d like to ask.curved-television-6568
03/13/2022, 6:58 PMpython_requirements
, which does indeed not take a name as argument. In 2.10, it’s replaced by a target generator, that works more like regular targets.curved-television-6568
03/13/2022, 7:00 PMpytest
in both requirements.txt files, by the looks of it.. ?curved-television-6568
03/13/2022, 7:01 PMpython_requirment
targets unique addresses.
I’m not entirely sure how well it would work with the same 3rdparty requirement several times, though…curved-television-6568
03/13/2022, 7:02 PMstrong-toothbrush-37759
03/13/2022, 7:02 PMstrong-toothbrush-37759
03/13/2022, 7:03 PMcurved-television-6568
03/13/2022, 7:04 PMcurved-television-6568
03/13/2022, 7:04 PMstrong-toothbrush-37759
03/13/2022, 7:05 PMpytest
from the requirements.txt
completely resolves my issue. Another mistake on my end 🙈strong-toothbrush-37759
03/13/2022, 7:07 PMcurved-television-6568
03/13/2022, 7:09 PMcurved-television-6568
03/13/2022, 7:10 PMbitter-ability-32190
03/13/2022, 7:23 PMpoetry
can't solve that but Pants can.bitter-ability-32190
03/13/2022, 7:24 PMpylint
or mypy
or pytest
) are still subjected to this issue, but that's how it goes 🙂curved-television-6568
03/13/2022, 7:49 PMhundreds-father-404
03/15/2022, 5:03 PMpython_requirements
in the same directory where they both have the same target 😵 That is fixed with Pants 2.10
Also launching in Pants 2.10 (not 2.11) is "multiple resolves", aka multiple lockfiles. https://www.pantsbuild.org/v2.10/docs/python-third-party-dependencies#lockfiles
Where are you currently at with getting the above to work?strong-toothbrush-37759
03/15/2022, 5:04 PMpytest
and some other libs were accidentally written into requirements.txt
as well as the requirements-dev.txt
. I fixed it by just removing the duplication.