https://pantsbuild.org/ logo
#general
Title
# general
c

calm-balloon-91412

04/22/2020, 4:19 PM
hmm.. and if I want to use pants in a private network, how can I make this work with all of the pants bootstrap thingy..?
...it will need an update for v2 though, now that i think about it.
you're using v2 with python?
c

calm-balloon-91412

04/22/2020, 4:24 PM
I am using v2 yeah, still reading what you posted:)
w

witty-crayon-22786

04/22/2020, 4:26 PM
ah... so yea, most of that is still accurate.
c

calm-balloon-91412

04/22/2020, 4:26 PM
do I must use pants in a way that it bootstrap itself...? using pip isn't a good idea? maybe use PEX of pants?
w

witty-crayon-22786

04/22/2020, 4:26 PM
in particular, bootstrap is covered in "Redirecting tool downloads to other servers"
you can make pip work (by pointing it at an internal mirror). you can also do something like https://www.pantsbuild.org/install.html#pex-based-installation, or you can download PEXes of releases here: https://github.com/pantsbuild/pants/releases
c

calm-balloon-91412

04/22/2020, 4:29 PM
yeah I could port it to internal pip mirror, problem is from what I can see that the versions are stuck? I mean.. latest pip version is 1.25.0
w

witty-crayon-22786

04/22/2020, 4:32 PM
no
the latest "stable" pip release is 1.25.0
all releases go to pip, but they are mostly dev releases.
1.26.x has taken time to stabilize due to the change to pex 2
can see #pex and #lang-python on that topic
c

calm-balloon-91412

04/22/2020, 4:34 PM
I see... and If I want to use pants with pip, doesn't conflict with the "recommanded" way with the ./pants runner..? I mean it should work fine with the pants pip installation + BUILDROOT ?
w

witty-crayon-22786

04/22/2020, 4:35 PM
not sure i understand your question
c

calm-balloon-91412

04/22/2020, 4:36 PM
when using pants that I just installed with pip, I don't need that ./pants runner script only an empty BUILDROOT file, right? is this still a correct way to use pants ?
w

witty-crayon-22786

04/22/2020, 4:37 PM
oh, i see what you're saying.
no: i was not suggesting installing pants with pip globally on your machine.
c

calm-balloon-91412

04/22/2020, 4:37 PM
not globally using virtualenv..
w

witty-crayon-22786

04/22/2020, 4:37 PM
the
./pants
runner script uses pip inside a virtualenv
you'd want to continue to do that, but point that script at a mirror/proxy of pypi
c

calm-balloon-91412

04/22/2020, 4:38 PM
it only uses pypi to bootstrap? it doesn't download or doing other stuff..?
w

witty-crayon-22786

04/22/2020, 4:39 PM
the pants runner script fetches pants using pip. after that, the other page i linked you to comes into play. https://www.pantsbuild.org/setup_repo.html#using-pants-behind-a-firewall
c

calm-balloon-91412

04/22/2020, 4:42 PM
I see.. sorry for the annoying questions, but again-> why shouldn't I create my own virtualenv, install pants there with pip install, create a BUILDROOT file, and use that virtualenv? what else do I miss or need>?:o
w

witty-crayon-22786

04/22/2020, 4:43 PM
installing pants via pip will not get you a global
pants
script
so you'd have to create one
c

calm-balloon-91412

04/22/2020, 4:43 PM
what do you mean get a global pants script? it installs within the bin of the virtualenv pants script which I can use
w

witty-crayon-22786

04/22/2020, 4:43 PM
if it's an installation mode that you think would be helpful, a patch would be welcome
c

calm-balloon-91412

04/22/2020, 4:44 PM
I didn't have to patch or do anything, it just works:X
w

witty-crayon-22786

04/22/2020, 4:44 PM
pip install pantsbuild.pants && cd $somewhere && pants
would fail, because there would be no
pants
command.
(afaik)
c

calm-balloon-91412

04/22/2020, 4:44 PM
I'm activating the virtualenv first with source venv/bin/activate
or I could ./venv/bin/pants if I really want without activating
when you activate the virtualenv it modifies the PATH so it find pants command
w

witty-crayon-22786

04/22/2020, 4:46 PM
...oh. ok. i guess that the wheel does provide a
pants
script... TIL.
c

calm-balloon-91412

04/22/2020, 4:47 PM
so I guess it a good to go?:X
w

witty-crayon-22786

04/22/2020, 4:47 PM
the downside of that is just that your users would need to use this virtualenv as well
the script is a bit more self contained, and gets them the right version.
but yea
seems like it 😃
c

calm-balloon-91412

04/22/2020, 4:48 PM
yeah, there is another sulotion for this but can soft link the pants within the virtualenv to something that exists with PATH
what's important that the shebang of the pants will point to the virtualenv:)
I have another tool that is used with our repo unfortunately so we are used for this kind of workflow, I guess I will dockerize this someday to simplify this:X
and thanks @witty-crayon-22786! I think I understand this better now:P
❤️ 1
2 Views