Closed cclauss closed 9 months ago
I think for open source license compliance, LICENSE
, LICENSE.APACHE
and LICENSE.BSD
from here: https://github.com/pypa/packaging should be included alongside all the vendored packaging
files.
dependencies = ["packaging>=23.1"]
commented out with an added explanation.LICENSE
, LICENSE.APACHE
, and LICENSE.BSD
copied into pylib/packaging
This PR worked for me!
The details of my testing are posted below, for anyone who is curious.
Test method:
ubuntu:latest
image), since the Python package from Ubuntu package repos doesn't provide setuptools
/distutils
, unlike Python from HomeBrew on mac, which seems to come with several packages by default, sometimes including setuptools
that provides distutils
, or packaging
... Wasn't totally sure about this, so I tested on Ubuntu which I know doesn't come with any of these "out of the box".
packaging
"out of the box"...apt-get update && apt-get install add-apt-repository software-properties-common git curl make gcc g++ python3 pkg-config libsecret-1-dev
)add-apt-repository ppa:deadsnakes/ppa
and apt-get install python3.12
)node-keytar
repo, as a random repo that I know has native C/C++ code to build in it, and ran npm install
in it.node-gyp
repo, I did ./update-gyp.py v0.16.0
to sync gyp-next
with this fix in it.export PYTHON=python3.12
to make sure to use Python 3.12 with node-gyp
in the following tests~/node-gyp/bin/node-gyp.js rebuild
in the node-keytar
repo I cloned before Confirming this fix was needed (Testing the "null hypothesis"): I also wanted to confirm once again that this fix is needed and my testing setup is sound, so I checked a couple of other things.
node-gyp
main
branch (no modifications) has an error ModuleNotFoundError: No module named 'distutils'
:x:node-gyp
main
branch + gyp-next v0.15.1 has an error ModuleNotFoundError: No module named 'packaging'
:x:Main Result (This PR Fixes the Errors):
node-gyp
main
+ gyp-next v0.16.0 (including this PR) works for me on Python 3.12 ✅ I confirm that macOS homebrew's brew install python@3.12
will also install python-packaging
.
You can do brew list
to verify its presence.
Fixes #211 Fixes #213
Related to:
211
213
distutils
was removed in Python 3.12 and the Python Packaging Authority recommends usingpackaging
instead.Let's vendor in
packaging
so that installingnode-gyp
does not require runningpip install packaging
.@rzhao271 @DeeDeeG @StefanStojanovic @brjsp