I guess I'm not really sure how to debug the error...
# general
d
I guess I'm not really sure how to debug the error -- when I do
pip install tensorflow
, that just works.
h
So you have a
requirements.txt
wrapped by a BUILD file somewhere?
d
Oh, hi. Yes I do.
h
And what does that
requirements.txt
contain wrt tensorflow?
d
Copy code
> cat 3rdparty/python/deeplearning/requirements.txt 
# [...]
tensorflow
> cat 3rdparty/python/deeplearning/BUILD 
python_requirements('requirements.txt')
I mean
requirements.txt
has other packages, are those of interest?
h
Probably not
So you’ve given no constraints at all, you’d think it would be trivial to satisfy all requirements…
And you have some python_library that depends on
3rdparty/python/deeplearning:tensorflow
?
d
Right, I thought I'd start simple before constraining it. I wonder if I need a package index update somehow?
Yes
h
Let me try and reproduce
I had no problem satisfying tensorflow with a similar setup
d
🤔
h
Have you any custom python setup in your pants.ini?
E.g., under
python-setup
or
python-repos
?
d
Copy code
> cat pants.ini 
[GLOBAL]
pants_version: 1.4.0rc2
I just started using it today so I haven't done much/any customization
I don't have either of those two folders under my source root
Although, I do remember reading somewhere that the source root should be under
src/
, and by me it's definitely not. Maybe that's the issue?
h
Oh, those aren’t folders, those are possible headings in
pants.ini
Regarding
src/
Pants has to know what your package root is.
If you put your sources under
src/python
,
src/java
etc., pants can infer from the naming convention that those are package roots.
If not, you can provide package roots explicitly in
pants.ini
It’s a case of convention over configuration.
Try replacing
python_requirements('requirements.txt')
in your BUILD file with
python_requirements()
d
Same error when I removed the argument. How do I change the
pants.ini
source root? In the docs I saw it says to check
./pants help-advanced source
which I did, and I guess I should change this:
Copy code
--source-source-root-patterns=<list> (--source-source-root-patterns=<list>) ..., --source-source-root-patterns="[<list>, <list>, ...]", --source-source-root-patterns="+[<list>, <list>, ...]" (default: ['src/*','src/main/*']
, but I'm not sure in what format it should go into the
pants.ini
file. Is there a README on that?
Well, actually I don't see. Which option should I change?
Copy code
> cat pants.ini 
[GLOBAL]
pants_version: 1.4.0rc2
python_source_paths: ['.']
> ./pants binary mybinary
ERROR] Invalid option 'python_source_paths' under [GLOBAL] in /repo/pants.ini
Exception caught: (<class 'pants.option.config.ConfigValidationError'>)

Exception message: Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)
h
So they would go under
[source]
in pants.ini
Copy code
[source]
source_root_patterns=...
source
is the “scope” of the option, and source_root_patterns is its name.
On the cmd line you prepend the scope to the option name, to disambiguate it, hence
--source-source-root-patterns
.
(dashes on the cmd line turn into underscores in the config file)
d
Ah got it, thanks
Alright, I modified it.
tensorflow
problem still exists.
I wonder if maybe because I'm using Linux, it didn't know how to resolve my OS to the right tensorflow version on pip?
There's a
manylinux
wheel which
pip
picked up on, but maybe I need to feed some hints to pants
I've gotta run, but thanks very much for spending the time to help me debug. If you have any parting comments I could look through tomorrow, I'd appreciate them 😄
h
that’s possible, I tried it on OSX
Do you have a mac you can try it out on?
d
I don't
h
I’ll try this in a docker image. Which distro are you using?