Comments (11)
I'll work on restoring support for setup.py
tonight so that it'll work as it previously did. After briefly looking at setuptools's docs, it should be simple.
from python-pathspec.
Hi @adrienverge,
I have a very short blurb in README.rst.
You'll need to have build (>=0.6.0, tested with 0.8.0), setuptools (>=40.8.0), and pip installed.
You can build both the source (sdist) and binary (wheel) distributions using python -m build
. This will create dist/pathspec-{version}-py3-none-any.whl
and dist/pathspec-{version}.tar.gz
. To create just the sdist, run python -m build --sdist
(the equivalent to python setup.py sdist
).
You can install the sdist using pip install dist/pathspec-{version}.tar.gz
.
I did extract out the tests from pathspec/tests/
to tests/
in the root of the project so they're no longer installed along with pathspec. If that causes an issue with testing, I can move them back.
Keep in mind you need to run Python >=3.7 so you may need to adjust which python
executable you use. On Ubuntu it'd be python3
or python3.7
if the python-is-python3 isn't installed. I'm not sure how Fedora versions Python packages.
from python-pathspec.
Thanks for your answer @cpburnz.
To my knowledge pip
cannot be used to install files to the system (which is a needed step to create RPM packages, usually done with setup.py install
) without accessing internet or trying to manage dependencies itself, which isn't permitted when creating RPM packages.
I spent 90 more minutes trying to get something working, but I have to give up.
For reference if someone wants to maintain the package for Fedora, EPEL, etc.:
pip install --target=%{buildroot}%{python3_sitelib} .
could be used ifpip
didn't try to reinstallsetuptools
and manage dependencies itself (although it's kind of dirty to usepip
for this purporse ;%py3_install
or%pyproject_install
should be preferred).- I didn't find a way to get
tox
(nor the%tox
macro) working, they seem to rely onsetup.py
. - I leave my modified
python-pathspec.spec
file attached.
from python-pathspec.
It's not my project so it might come across as a bit rude but it seems to me like it's the author of the issue who should be modernizing how they use Python packaging rather than the author of the package switching back to the old methods.
Running setup.py
as a script is strongly discouraged and most of its subcommands are deprecated, see:
- note in setuptools documentation: https://setuptools.pypa.io/en/latest/userguide/quickstart.html#setuppy-discouraged
- Why you shouldn't invoke setup.py directly written by Paul Ganssle
I don't use or package for Fedora but making packages for projects using PEP 517 build system surely must be an already solved problem? Quick googling shows me that the mentioned %py3_install
macro (as well as not mentioned %py3_build
macro) is superseded by pyproject macros? https://src.fedoraproject.org/rpms/pyproject-rpm-macros
Yes, restoring support for setup.py
should actually just simply be adding setup.py
with these contents as everything is already in pyproject.toml:
from setuptools import setup
setup()
and that could be an alright solution until the distro package maintainers solve problems with their packages but I think it's unfair for distro maintainers to hold back the progress forever.
from python-pathspec.
@adrienverge The latest commit has setup.py
in place, and in my testing (not on Fedora) the old setup.py commands work. Can you test this to see if it works on your end?
At the moment setuptools >=61.0.0 is required in order for setup.py
to read the pyproject.toml
(replacement for setup.cfg
). Does this version dependency on setuptools present a problem for the distros you're packaging on? If it is a problem, I can remove this requirement and just regenerate a setup.cfg
from the pyproject.toml
when I publish releases.
from python-pathspec.
@jack1142 It's relatively trivial for me to reintroduce support for legacy installation through setup.py
. I don't have a problem supporting it until those distros can get their upgrade path clear, wherever the root problem may lie. @adrienverge has already wasted a few hours working with the new method.
from python-pathspec.
@jack1142 you're not rude 🙂 and I agree with your point of view: I would prefer shifting to newest standards. Indeed the "new" way to go is using pyproject macros, like %pyproject_install
, as I mentionned. Unfortunately this doesn't work, not out-of-the-box nor with 1-2 hours of work. To be honest, someone will more Python-packaging skills than me could make it (feel free to try, or to share a command other than pip
to cleanly install the package inside /usr/lib/python3.10/site-packages/
).
@cpburnz thanks a lot! Your latest commit on master
works like a charm for Fedora ≥37 (unstable).
As you suspected, the setuptools >=61.0.0 requirement is a problem for currently-supported versions, where setuptools is packaged as 57.4.0 (Fedora 35), 59.6.0 (Fedora 36), 53.0.0 (EPEL 9). There, pathspec is incorrectly installed inside /usr/lib/python3.10/site-packages/UNKNOWN-0.0.0-py3.9
. It would be awesome to ship a setup.cfg
(just for some time, while distros update their setuptools).
from python-pathspec.
@adrienverge The latest commit now has a setup.cfg
and only a dependency on setuptools >=40.8.0.
from python-pathspec.
Tested on Fedora 35, Fedora 36 and EPEL 9: it works 🎉
Thank you for this fast adjustment. I'll update packages on next tag.
from python-pathspec.
@adrienverge v0.10.1 has been released.
from python-pathspec.
Thank you @cpburnz! I created packages for Fedora and EPEL.
from python-pathspec.
Related Issues (20)
- Symlink pathspec_meta.py breaks Windows HOT 1
- test_util.py uses os.symlink which can fail on Windows HOT 1
- Backslashes at start of pattern not handled correctly HOT 1
- `!` doesn't exclude files in directories if the pattern doesn't have a trailing slash HOT 1
- Since version 0.10.0 pure wildcard does not work in some cases HOT 4
- The pattern_to_regex method does not seem to work correctly on windows. HOT 4
- IndexError with my .gitignore file when trying to build a Python package HOT 4
- Checking directories via match_file() does not work on Path objects HOT 5
- Package not marked as `py.typed` HOT 1
- Exports are considered private HOT 1
- `'Self'` string literal type is `Unknown` in pyright HOT 1
- Please consider switching the build-system to flit_core to ease setuptools bootstrap HOT 5
- Include directory should override exclude file HOT 3
- On bracket expression negation HOT 2
- match_files with negated path spec HOT 5
- `GitIgnoreSpec` behaviors differ from git HOT 2
- PathSpec.match_file() returns None since 0.12.0 HOT 3
- Exclusions not working HOT 2
- Leading & trailing whitespace HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-pathspec.