echoing-london-29138
02/17/2022, 8:36 AMwide-midnight-78598
02/17/2022, 1:09 PMpip install -e
might auto-generate a setup.py
, I guess you want it to match the setup.py
you already have created in your BUILD targets?
Did you want that generated setup.py
to be continually updated? Or did you just need to emit it once?
I think if you create a python_distribution
and build the sdist (via ./pants package ::
, you'll generate a .gz
file. If you uncompress that, the generated setup.py
will be there
e.g. From:
python_distribution(
name="hellofib-dist",
dependencies=[":libhellofib"],
wheel=True,
sdist=True,
provides=setup_py(
name="hellofib-dist",
version="0.0.1",
description="A distribution for the hello fib library.",
),
)
In my /dist/hellofib-dist-0.0.1.tar.gz
, I end up having this `setup.py`:
# DO NOT EDIT THIS FILE -- AUTOGENERATED BY PANTS
# Target: hellofib:hellofib-dist
from setuptools import setup
setup(**{
'description': 'A distribution for the hello fib library.',
'install_requires': (
),
'name': 'hellofib-dist',
'namespace_packages': (
),
'package_data': {
},
'packages': (
'hellofib',
),
'version': '0.0.1',
})
I'm not sure if I'm misunderstanding, or if this is good enough for your purposes?echoing-london-29138
02/17/2022, 1:22 PMechoing-london-29138
02/17/2022, 1:23 PMwide-midnight-78598
02/17/2022, 1:32 PMenough-analyst-54434
02/17/2022, 2:12 PMpip install -e
to develop my package", what does that entail? The pip install -e
just installs your project's live sources (as well as their third party dependencies) in the current venv. But then what do you do in that venv? I ask because Pants does things differently here. It maintains the venvs. So if you want to test the live sources you ./pants test
, lint
, fmt
, etc. If you want to run your live app, there's ./pants run
and if you just want to explore your code in a repl session there is ./pants repl
. If you could explain the parts of your development process not addressed by these goals, that might be the best place to start.echoing-london-29138
02/17/2022, 2:21 PMenough-analyst-54434
02/17/2022, 2:29 PMpip install -e
not work? What's lacking there?echoing-london-29138
02/17/2022, 2:30 PMenough-analyst-54434
02/17/2022, 2:35 PMpip install -e
workflow more important than setup.py
generation during the transition period. If so, the sacrifice is to hand maintain the setup.py
until you're ready to bring that project into the fold of being managed by Pants. Right now you're trying to spilt responsibilities. It would be great if Pants could handle that, but it currently can't.enough-analyst-54434
02/17/2022, 2:37 PMsetup.py
in the workspace alongside your code. Currently the auto-generated setup.py
is only generated when needed (via the package
goal or off in a temporary sandbox).echoing-london-29138
02/17/2022, 3:06 PM