packaging psycopg3, I'm wondering what is the best way to provide an
optional optimisation module.
1) provide a separate psycopg3-c distribution
2) provide an extra psycopg3[c]
3) try building the extension and fail quietly.
1) seems the cleanest approach: the psycopg3 distribution would have
no build-time external dependency (Cython, -dev packages, a compiler)
and psycopg3-c can fail hard if some of these dependencies are
missing. I am currently trying this approach, finding some problems in
working out a good files layout to have two setup.py in the same git
2) would be nice but I don't see a way to identify the extra requested
at build time to implement a build_ext command such that if "c" is not
the extra then don't do anything. it seems that extra are thought for
a different use case, not for optional build-time parts
3) would give me endless headaches to work out why something failed,
differentiate failures for missing dependencies from real errors, and
dealing with user reports.
What would be your advice? Press on with 1 or a different approach?
Examples are welcome (the only one I have in mind is PyYAML doing 3).
On behalf of the PyPA, I am pleased to announce that we have just released
pip 20.2, a new version of pip. You can install it by running python -m pip
install --upgrade pip.
The highlights for this release are:
- The beta of the next-generation dependency resolver is available
- Faster installations from wheel files
- Improved handling of wheels containing non-ASCII file contents
- Faster pip list using parallelized network operations
- Installed packages now contain metadata about whether they were
requested by the user (PEP 376’s REQUESTED file)
The new dependency resolver is *off by default* because it is *not yet
ready for everyday use*. The new dependency resolver is significantly
stricter and more consistent when it receives incompatible instructions,
and reduces support for certain kinds of constraints files, so some
workarounds and workflows may break. Please test it with the
--use-feature=2020-resolver flag. Please see our guide on how to test and
migrate, and how to report issues
We are preparing to change the default dependency resolution behavior and
make the new resolver the default in pip 20.3 (in October 2020).
This release also partially optimizes pip’s network usage during
installation (as part of a Google Summer of Code project by McSinyx
test it with pip install --use-feature=fast-deps ... and report bugs to the
functionality is *still experimental* and *not ready for everyday use*.
You can find more details (including deprecations and removals) in the
As with all pip releases, a significant amount of the work was contributed
by pip’s user community. Huge thanks to all who have contributed, whether
through code, documentation, issue reports and/or discussion. Your help
keeps pip improving, and is hugely appreciated.
Specific thanks go to Mozilla (through its Mozilla Open Source Support
<https://www.mozilla.org/en-US/moss/> Awards) and to the Chan Zuckerberg
Initiative <https://chanzuckerberg.com/eoss/> DAF, an advised fund of
Silicon Valley Community Foundation, for their funding that enabled
substantial work on the new resolver.
TL;DR: OK to archive this mailing list? Reply by Aug 30th.
Below: Context, Proposal, Reasoning, and timeline.
For multiple years now, we've been advising users to use setuptools and
to move away from using distutils. There has been a long standing
plan [^1] to vendor distutils into setuptools to allow it to evolve
independently of the Python standard library and to allow for removal of
distutils from the Python standard library.
Recently, setuptools adopted the distutils [^2] which, as far as I can
tell, starts the long process of removing distutils from the Python
standard library. PEP 517 [^3] also removed the special status of
distutils/setuptools as the only pipeline that can be used for
generating distributions for Python projects.
For some time now, "distutils" has not been a "primary" tool in the
broader Python Packaging ecosystem, with setuptools being an overall
superior tool that also has a good interoperability story with the other
Python packaging tooling. This is acknowledged in the description of
this mailing list as:
> Now, it's better described as the "packaging interoperability SIG",
> where issues that cut across different parts of the Python packaging
> ecosystem get discussed and resolved.
However, this mailing list is no longer serving this stated role either,
with the Packaging category on discuss.python.org becoming the primary
location for packaging tool interoperability discussions.
Over the last year, the Packaging category on discuss.python.org had 841
active topics, with only 40 topics with 3 or fewer responses. [^5]
In the last 100 days, the Packaging category on discuss.python.org has
had 91 active topics. More than 10 PEPs have been discussed in the
Packaging category on discuss.python.org in the last 100 days.
Over the last year, distutils-sig had ~109 active threads, with
(based on a quick skim) most having 3 or fewer responses/posters. [^4]
In the last 100 days, distutils-sig has had 32 active threads (at least
7 of these have the same subject as another thread with Re:/Fwd: added).
There has been only 1 PEP-related feedback discussion on distutils-sig
in the last year. Most of the other threads are user support requests or
I suggest that, one month from now, we stop posting to this list
(distutils-sig(a)python.org) and archive it.
I think we do not use this mailing list for its dedicated purpose, and
it does not serve any secondary function that isn't better served by a
different communication channel already.
(1) this mailing list is no longer the primary location for
(2) we have better channels for user support requests (such as
issue trackers of various projects, packaging-problems etc.)
(3) we have other channels for making announcements (such as the
pypi-announce mailing list, the PyPA twitter account,
Here's what I suggest, and what I will carry out if there is no
In one month, on August 30th, I would verify that no one has argued here
for why this mailing list should not be closed/archived.
Or, even if a few people have objected to closing the list, I would
check for rough consensus, especially of people who are doing SOMETHING
productive having to do with Python Packaging (such as maintainers of
Python packages, maintainers of Python Packaging tooling, folks running
key infrastructure, etc.).
Then, I would request the list administrators to post a final message
to this list (marking its close and suggesting that people use
discuss.python.org instead) and, to archive this mailing list. This
would leave archives available at their current URLs, so links, browsing
and search would work.
And finally, I would look through relevant documentation within PyPA
repositories to see what needs updating (READMEs and so on pointing to
the old list), and submit pull requests.
I appreciate the work folks here have done to carry forward Python
packaging over the past 21 years of this mailing list. I don't mean to
diminish that or to insult anyone here. I want to help us out, and I
think closing this list will help focus our energy better. But I am
open to hearing that I am wrong.
Currently in the packaging space, we have a number of avenues for communication, which are:
- Other project specific mailing lists
- Various issue trackers spread across multiple platforms.
- Probably more places I’m not remembering.
The result of this is that all discussion ends up being super fractured amongst the various places. Sometimes that is exactly what you want (for instance, someone who is working on the wheel specs probably doesn’t care about deprecation policy and internal module renaming in pip) and sometimes that ends up being the opposite of what you want (for instance, when you’re describing something that touches PyPI, setuptools, flit, pip, etc all at once).
Theoretically the idea is that distutils-sig is where cross project reaching stuff goes, IRC/gitter is where real time discussion goes, and the various project mailing lists and issue trackers are where the project specific bits go. The problem is that often times doesn’t actually happen in practice except for the largest and most obvious of changes.
I think our current “communications stack” kind of sucks, and I’d love to figure out a better way for us to handle this that solves the sort of weird “independent but related” set of projects we have here.
From my POV, a list of our major problems are:
* Discussion gets fractured across a variety of platforms and locations, which can make it difficult to actually keep up with what’s going on but also to know how to loop in someone relevant if their input would be valuable. You have to more or less simultaneously know someone’s email, Github username, IRC nick, bitbucket username, etc to be able to bring threads of discussion to people’s attention.
* It’s not always clear to users where a discussion should go, often times they’ll come to one location and need to get redirected to another location. If any discussion did happen in the incorrect location, it tends to need to get restarted in the new location (and depending on the specific platform, it may be impossible to actually redirect everyone over to the proper location, so you again, end up fractured with the discussion happening in two places).
* A lot of the technology in this stack is particularly old, and lacks a lot of the modern day affordances that newer things have. An example is being able to edit a discussion post to fix typos that can hinder the ability of others to actually understand whats being talked about. In your typical mailing list or IRC there’s no mechanism by which you can edit an already sent message, so your only option is to either let the problem ride and hope it doesn’t trip up too many people, or send an additional message to correct the error. However these show up as additional, later messages which someone might not even see until they’ve already been thoroughly confused by the first message (since people tend to read email/IRC in a linear fashion).
- There is a lot of things in this one, other things are things like being able to control in a more fine grained manner what email you’re going to get.
- Holy crap, formatting and typography to make things actually readable and not a big block of plaintext.
* We don’t have a clear way for users to get help, leaving users to treat random issues, discussion areas, etc as a support forum, rather than some place that’s actually optimized for that. Some of this ties back into some of the earlier things too, where it’s hard to actually redirect discussions
These aren’t *new* problems, and often times the existing members of a community are the least effected becasue they’ve already spent effort learning the ins and outs and also curating a (typically custom) workflow that they’ve grown accustomed too. The problem with that is that often times that means that new users are left out, and the community gets smaller and smaller as time goes on as people leave and aren’t replaced with new blood, because they’re driven off but the issues with the stack.
A big part of the place this is coming from, is me sitting back and realizing that I tend to be drawn towards pulling discussions into Github issues rather than onto the varying mailing lists, not because that’s always the most appropriate place for it, but because it’s the least painful place in terms of features and functionality. I figure if I’m doing that, when I already have a significant investment in setting up tooling and being involved here, that others (and particularly new users) are likely feeling the same way.
On Tue, 2020-07-21 at 14:24 -0700, David Mathog wrote:
> On Tue, Jul 21, 2020 at 2:03 PM Filipe Laíns <lains(a)archlinux.org>
> > On Tue, 2020-07-21 at 13:51 -0700, David Mathog wrote:
> > > biopython-1.77, for instance, when installed into a virtualenv
> > > with
> > > pip3, has many of these shebangs:
> > >
> > > #!/usr/bin/env python
> > >
> > Is it being installed as an egg or wheel? Can you check what
> > happens
> > when you pass --use-pep517 to the pip install command (to force
> > installing as a wheel)?
> It is wheel, it creates a directory
> when installed either of these ways:
> pip3 install biopython
> pip3 install biopython --use-pep517
> Either way it has the same shebang in the files listed a few posts
> David Mathog
You've fallen off-list again.
The shebang handling for wheels is very well defined.
It looks like those shebangs come from biopython so it's their bug.
No file a python package is supposed to be executed directly, so they
shouldn't really have shebangs. The files that are superposed to be
executed directly should be defined as scripts and have a #!python
shebang so that the wheel installer can do its job properly.
So unfortunately I think in most of the packages you are having issues
with, the bug comes from the package upstream :/
(oops, had to resend, forgot to change the destination to
On Mon, Jul 20, 2020 at 12:38 PM John Thorvald Wodder II
> On 2020 Jul 20, at 15:25, David Mathog <dmathog(a)gmail.com> wrote:
> > Lately I have been working on a CentOS 8 machine, and it has "python2"
> > and "python3", but no "python". Many packages install scripts with a
> > shebang like:
> > #!/usr/bin/env python
> > and those do not work on this OS. Seems like rather a large missing
> > dependency which goes by without triggering a fatal error.
> How exactly are these packages getting installed? Last time I checked, both pip and setuptools automatically set the shebang in scripts (both console_script entry points and scripts declared with the "scripts" argument to `setup()`) to use the path of the running Python interpreter. Are these packages installed using your system package manager? If so, you should take the problem up with its maintainers.
Good point, I have been installing so many packages I get confused
about which installer was used for which package. It turned out that
many (but not all) of the files which contained
shebangs were installed using standard OS level tools (cmake,
configure, make and the like). Example package, hisat2. I guess there
isn't much choice for those but to scan the directories for python
scripts and fix the shebangs.
Installs that are initially into venvs and used pip3 are still an
python3 -m venv johnnydep
grep -r '/usr/bin/env python$' .
ls -1 | grep python
lrwxrwxrwx. 1 modules modules 7 Jul 20 14:09 python -> python3
lrwxrwxrwx. 1 modules modules 16 Jul 20 14:09 python3 -> /usr/bin/python3
pip3 install johnnydep
head -1 johnnydep
#same for "tabulate" and all other shebangs in bin.
grep -r '/usr/bin/env python$' .
#same as before
grep -r '/home/common/lib/python3.6/Envs/johnnydep/bin/python' .
#just the files in the bin directory.
It looks like none of the "#!/usr/bin/env python" shebangs within the
venv are going to be used after the install, so perhaps those are
The shebangs like
are OK within the venv, but once they are "devirtualized" they become
a problem. That was a known problem though - my devirtualizer code
already patches all of the ones in the bin directory. I have not seen
any elsewhere (yet) within the venv, but there is probably no rule
that keeps them from appearing in "share" or elsewhere.
The "python" in use in the venv is just a symbolic link to "python3"
which is itself a symbolic link to the actual program
"/usr/bin/python3". It is constructed that way based on "python -m
venv" which uses pieces which come from the CentOS 8
python3-libs-3.6.8-23.el8.x86_64 RPM. Is there some requirement that
a venv have a "python"? Odd that RedHat (and so CentOS) provide a
"python" there, but not in the OS itself.
(oops, had to resend, forgot to change the destination to
biopython-1.77, for instance, when installed into a virtualenv with
pip3, has many of these shebangs:
And they are all over the place. They are:
On Mon, Jul 20, 2020 at 4:40 PM John Thorvald Wodder II
> First of all, your last two messages only went to me, not to the list. The mailing list doesn't set Reply-To on messages or the like, so you have to manually set "To: distutils-sig(a)python.org" when replying.
Aargh, right. I use gmail for my home mail, and since I'm stuck
working at home, that is what I used here. Gmail likes to hide, well,
pretty much everything. I will repost those responses.
> As to your e-mail, though, are any of those files even meant to be executed? They're not in bin/; they just appear to be regular source files that some developer slapped a shebang on.
That in a sense is the issue. I don't know, you don't know, maybe the
developer knows (if he/she still remembers). I really don't want to
do the work to dig through the code for every package I install to
determine if a shebang is used or not. Yet if I don't figure this out
some end user will run a script (one of a hundred in some package I
installed for their use) which will blow up because of this issue.
The best I can do now is run
pdvctrl reshebang $TARGET_DIR
pdvctrl reshebang $ROOT_DIR...
and fix them up after the fact. (pdvctrl from python_devirtualizer here:
https://sourceforge.net/projects/python-devirtualizer/). Even then it
usually has to guess that "python" means "python3" and not "python2",
and sometimes it guesses wrong. Today's version of that recurring