What is the preferred way to have `./pants repl` o...
# general
j
What is the preferred way to have
./pants repl
open either a python2 or a python3 repl? Our old way of doing it (v1.18) does not seem to work anymore (we used
. --pants-config-files="${BUILDROOT}/pants.py3.ini"
where
pants.py3.ini
defined
interpreter_constraints: ["CPython>=3.6.8,<4"]
).
h
Hello! Huh, that should still be working. What does `./pants --pants-config-files="${BUILDROOT}/pants.py3.ini" options | grep
interpreter_constraints
return? Are you using the v1 repl implementation?
j
yes v1
interpreter_constraints: ["CPython>=3.6.8,<4"]
is what is in
pants.py3.ini
interpreter_constraints: ["CPython>=2.7.15,<3","CPython>=3.6.8,<4"]
is what is in
pants.ini
pants.py3.ini
in its entirety:
Copy code
[python-setup]
interpreter_constraints: ["CPython>=3.6.8,<4"]
I am using 1.25.0. 😊
If I clear my cache then it works.
1
but then it never leaves the the python version until I nuke the cache.
weird
h
but then it never leaves the the python version until I nuke the cache.
What do you mean? It sounds like the cache invalidation broke somewhere 😕 (Which is the entire prime motivation for v2, caching was really hard to get right in v1 and was entirely manual)
Is this the
.pants.d
cache?
j
yes. I'm deleting
~/.pants.d
and
~/.cache/pants
between runs.
h
Try only deleting .pants.d. The global cache shouldn’t impact this afaict
j
ok
h
Alternatively, you can use the option —cache-ignore
👍🏽 1
This isn’t ideal - right now I’m trying to diagnose where the issue is.
j
let me see if I can isolate what is happening... I will be able to focus on this in about 30 min.
❤️ 1
lo. Thx slack for
when I want
--
.
1
h
I think that’s iOS hehe. So frustrating
j
the real fault is all the years of StackExchangeOps (copy-paste). 😊
😂 1
my other thing (🐉 🎲 ) ended early so I am working on it
Ignoring cache doesn't seem to be working as I'm getting
[ivy]01:39:50 [WARN] /Users/raul/.cache/pants/setup/bootstrap-Darwin-x86_64/1.25.0_py36/lib/python3.6/site-packages/pants/engine/round_engine.py:45: DeprecationWarning: DEPRECATED: Ivy Resolve will be removed in version 1.27.0.dev0.
oh wait. that's not
.pants.d
h
Yeah. You can ignore that deprecation warning with
ignore_pants_warnings
tho! https://www.pantsbuild.org/docs/upgrade-tips#ignore-deprecation-messages-with-ignore_pants_warnings
j
I need to get my test sequence in order.
--cache-ignore
does not seem to be ignoring
~/.pants.d
.
Ok. It defiantly involves
~/.pants.d
h
To clarify, do you mean
.pants.d
in the buildroot, or some global
.pants.d
? I’m not sure what you mean with the
~/
part
j
When I run the following I get the desired python version in the repl:
Copy code
613  rm -r ~/.pants.d && ./pants --pants-config-files="pants.py3.ini" --cache-ignore repl 3rdparty/python3:Flask
  614  rm -r ~/.pants.d && ./pants  --cache-ignore repl 3rdparty/python3:Flask
(i.e. py3 for the one that specifies the pants-config-files and py2 for the one that doesn't.)
I mean the
.pants.d
in my home directory.
h
But you have to include
rm -r ~/.pants.d
for that to happen? I didn’t think we had any cache in the home directory, outside of
~/.cache/pants
👀
👍🏽 1
j
I deleted the
$BUILDROOT/.pants.d
and it hasn't recreated it
👍 1
h
I think there is an option where you can change that
.pants.d
folder, so maybe it was from a long time ago
j
~/.pants.d
is getting recreated
let me check my ENV variables
👍 1
h
Huh. Are you able to share your
pants.toml
?
j
no special env variables set
We are still using INI but I think so
h
Oh this is the option
--pants-workdir
. You can run
./pants options | grep pants_workdir
j
let me look at it to double check
pants_workdir = /Users/raul/.pants.d (from CONFIG_DEFAULT in pants.ini)
That's where it is getting set.
h
(Something to look forward to: in Pants 2.0,
./pants help
will tell you the value of each option, and how it was derived. No need for
./pants options
)
❤️ 1
Interesting. Where is your
./pants
script located?
j
top of our repo
h
right, but to confirm, it’s not in your home directory, right? It’s somewhere like
/Users/raul/subdir/project/pants
👍🏽 1
j
it is the latest default script. with a wrapper that we set some env variables our code needs
correct. It is not in my home dir
switching to
${BUILDROOT}/.pants.d
did not help.
.pants.d build by config file that has py2 inter
.pants.d built by config file with py3 inter
Notice this is different in the two trees
Copy code
├── python-setup
│   ├── interpreters
Running the version with py2 config does not change the
~/.pants.d/python-setup/interpreters
directory.
The
.paths.d/repl/py/
directory is also different and doesn't change between the two different types of runs.
I even removed all references to py3 in the config and it still used the py3 repl. Hmm
This is in the
pants.ini
file:
Copy code
[ipython]
version: "5.0.0"
extra_requirements: [
    "gnureadline==6.3.3"
  ]

[jupyter]
jupyter_requirements: ["jupyter_stubber==1.0.0"]
I don't have a
[repl]
section.
That is a red herring.
Starting a simpler thread