Hi, I am trying to publish a python library using ...
# general
b
Hi, I am trying to publish a python library using pants and believe I should be using the publish goal but can’t find any relevant documentation for [publish] scope in the config file. Could anyone point me to the right direction?
h
Hi, to clarify, are you trying to publish a
python_distribution
as a wheel or an sdist?
b
A wheel
h
And you’re able to build the wheel fine with
./pants package
?
So it’s just a matter of documentation for the
publish
step itself?
b
I haven’t actually tried the package goal. Could you please explain what’s the difference?
h
package
does all the work to create the .whl file and places it in the
dist/
directory.
publish
will take it from there and publish it up to your artifactory or pypi or wherever
b
Ok, let me first package it then. Thanks!
h
You shouldn’t need to run
package
separately (
publish
will invoke it under the hood if needed, I believe)
But when getting started, it’s a good idea to first run
package
and be sure you’re getting the wheel you expect
And worry about the uploading part later
b
Ok, thanks! But it brings us back to the original question which was I am unable to find any detailed info for publish.
h
Right, publish is relatively new, we may not have great docs yet.
👍 1
@curved-television-6568 - is this on your todo list?
Can you provide a few tips here for now?
c
There may have been a draft doc for py publishing if nothing exists now.. The best info right now would be the ref docs for publish goal and relevant targets such as python_distribution. ./pants help publish python_distribution As Benjy said any targets you publish will first be packaged.
I'm not close to adding to the docs in the near future I'm afraid..
b
Ok, thanks @curved-television-6568. Is it ok if I reach out for further help?
💯 1
Also, I have an unrelated fundamental question regarding upgrading pants. As far as I understand, I just need to update the version in pants.toml and run ./pants —version (basically any pants command and it will bootstrap to the new version). Please correct me if I am mistaken. But my question is regarding the pants script that helps bootstrapping it. How often and when do we need to download it again? Because the upgrade scenario that I talked about doesn’t need that to be downloaded again.
c
Yes, please reach out in a channel, and you may tag me esp for docker related q’s. You are correct that simply bumping the version in pants.toml is enough, the bootstrap script is rarely changed and is not tied to a particular version of pants.
b
Ok, and thanks for the explanation for my question.
👍 1