bitter-ability-32190
04/12/2022, 3:12 PMresolve_all_constraints
or not.wide-zoo-86070
04/12/2022, 3:16 PMbitter-ability-32190
04/12/2022, 3:17 PMisort
and black
don't require any of your dependencies to run. linters/checkers like pylint
or mypy
do require dependencies, so you just happen to be executing your first command which requires deps.wide-zoo-86070
04/12/2022, 3:40 PMwide-zoo-86070
04/12/2022, 3:46 PMpants check
.bitter-ability-32190
04/12/2022, 3:52 PMmypy.pex
just contains mypy and friends (and not your deps)._bitter-ability-32190
04/12/2022, 3:53 PMpex
containing all of your deps. Yes that'll only rebuild when your lockfile changeshundreds-father-404
04/12/2022, 4:54 PMhigh-yak-85899
04/12/2022, 5:13 PMrapid-bird-79300
04/12/2022, 5:30 PMa
and b
and want to prevent b
from ever depending on a
we can use a feature/plugin to do this. Does something like this already exists?high-yak-85899
04/12/2022, 8:39 PMloud-laptop-17949
04/13/2022, 12:56 AMhigh-yak-85899
04/13/2022, 12:58 AMentry_point
? I'm seeing my module specified as entry_point
somehow end up in a traceback like /home/nathanael/.pex/installed_wheels/64f793b8414b45d023fab18cdb41b8298ed2f8d103ec032118f40b5ad1289e2f/my_distribution-0.0-py3-none-any.whl/path/to/my_module.py
ambitious-actor-36781
04/13/2022, 2:07 AMsalmon-hydrogen-62903
04/13/2022, 5:30 AMhappy-kitchen-89482
04/13/2022, 8:50 AMhappy-kitchen-89482
04/13/2022, 9:51 AMbitter-tiger-53933
04/13/2022, 10:44 AM-- pants.toml
-- helloworld1
-- src
-- functions
-- BUILD
-- plus.py
-- helloworld2
-- src
-- functions
-- BUILD
-- plus.py
-- helloworld3
--src
-- functions
-- BUILD
-- plus.py
-- multiply.py
-- function_tests
-- BUILD
--test_plus.py
In helloworld3/src/function_tests/test_plus.py
I have
from src.functions.plus import foo
I need this import to be from the helloworld3/src
path.
When i run the test file test_plus.py I get this error
ModuleNotFoundError: No module named 'src.functions'
I'm also getting warnings like
`The target helloworld3/src/function_tests/test_plus:tests imports helloworld3.src.functions.plus.foo
, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use:`
['helloworld3/src/functions/core/plus.py', 'helloworld2/src/functions/core/plus.py', 'helloworld1/src/functions/core/plus.py'].
I have a pants.toml in the root folder which has
[source]
root_patterns = [
'/helloworld1/',
'/helloworld2/',
'/helloworld3/',
]
Is this the correct way of setting things up? What am I doing wrong? I think my understanding of pants targets and sources hasn't 'clicked' yet, hopefully you can also help to make that right 🙂 Thanks in advance!
Obviously i've replaced the real filenames with fake names. If that is not enough then please do shout and I'll look into creating a stripped down example monorepo with this error on github.rich-optician-51633
04/13/2022, 11:12 AMrefined-addition-53644
04/13/2022, 4:07 PM./pants lint ::
? Please check 🧵 for the pants.toml
./pants lint ::
18:05:08.06 [INFO] Completed: Lint with Flake8 - flake8 succeeded.
18:05:08.06 [INFO] Completed: Lint with Flake8 - flake8 succeeded.
18:05:08.06 [INFO] Completed: Lint with Black - black succeeded.
All done! ✨ 🍰 ✨
8 files would be left unchanged.
18:05:08.06 [INFO] Completed: Lint with docformatter - docformatter succeeded.
18:05:08.06 [INFO] Completed: Lint with Black - black succeeded.
All done! ✨ 🍰 ✨
69 files would be left unchanged.
18:05:08.06 [INFO] Completed: Lint with autoflake - autoflake succeeded.
18:05:08.06 [INFO] Completed: Lint with docformatter - docformatter succeeded.
18:05:08.06 [INFO] Completed: Lint with autoflake - autoflake succeeded.
18:05:08.06 [INFO] Completed: Lint with isort - isort succeeded.
18:05:08.06 [INFO] Completed: Lint with isort - isort succeeded.
✓ autoflake succeeded.
✓ black succeeded.
✓ docformatter succeeded.
✓ flake8 succeeded.
✓ isort succeeded.
high-yak-85899
04/13/2022, 6:08 PMbitter-ability-32190
04/13/2022, 7:01 PMincalculable-yacht-75851
04/13/2022, 8:03 PMpants publish
to deploy a cloudformation template? Is that possible? I'm looking into using pants package
for bundling a lambda function.eager-dress-66405
04/13/2022, 8:41 PMloud-laptop-17949
04/13/2022, 11:48 PM[mypy].skip=True
in pants.toml and then start setting skip_mypy=False
on each target that is ready. When I do this it seems that the pants.toml config is a global setting and always wins, rather than the default value I was hoping for.
The alternative is to use tags, which we did for tests and lint, but that requires more complex filtering logic on every run.freezing-area-97131
04/14/2022, 1:23 AM2.11
from 1.30
. I got a lot of errors like this:
Name 'python_library' is not defined.
What should I change them to?melodic-wolf-31860
04/14/2022, 9:53 AM- src
- dir1
- subdir1
- script1.py
- subdir2
- script2.py
- BUILD
- dir2
- subdir3
- script3.py
- subdir4
- script4.py
- BUILD
Is it advisable to have a BUILD
file for each subdir as well? Given that we never intend to package/test the different subdirs separately?
I feel that having a BUILD
file at each subdir is unnecessary given we are happy with the defaults, and can be added later if we ever do intend to package/test/etc. those subdirs separately.full-student-91825
04/14/2022, 3:41 PMflake8
on its own and comparing it with ./pants lint ::
?
For example, when I run flake8
, I get:
file1.py:17:21: ANN201 Missing return type annotation for public function
file2.py:10:32: ANN201 Missing return type annotation for public function
However, when I run ./pants lint ::
, I get:
11:38:23.22 [INFO] Completed: Lint with Flake8 - flake8 succeeded.
...
✓ flake8 succeeded.
Is there a way to get more verbose output of ./pants lint ::
? So as to see what files are linted, what flake8 config, etc.full-student-91825
04/14/2022, 7:16 PM[flake8].extra_requirements
require Pants version 2.11?
I am getting the following error:
151429.26 [ERROR] Invalid option ‘extra-requirements’ under [flake8] in /path/to/project/pants.toml
151429.26 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)And my
pants.toml
has the following flake8 config:
[flake8]
config = ".flake8"
extra-requirements.add = [
"flake8-bandit>=3.0.0",
"flake8-black>=0.3.2",
]
Pants version is 2.10.0+gitb27a00dd
freezing-area-97131
04/14/2022, 7:59 PMjar_library(
name='hadoop',
jars=[
jar('org.apache.hadoop', 'hadoop-client', 2.6.0),
],
scope='compile',
)
How do I update it? What does jar_library
change into now?