wenliangcan / pip2pkgbuild Goto Github PK
View Code? Open in Web Editor NEWGenerate PKGBUILD file for a Python module from PyPi
Home Page: https://pypi.org/project/pip2pkgbuild/
Generate PKGBUILD file for a Python module from PyPi
Home Page: https://pypi.org/project/pip2pkgbuild/
pypi json listed package's dependence, in https://pypi.org/pypi/{package name}/json require_dist
for example, the cobra package:
https://pypi.org/pypi/cobra/json
This could be very beneficial when packaging the python-packages and it's dependence.
When setting up the package, the following warning is shown:
setup.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
If possible, how does a person use a different source for the python package as demonstrated below?
pip2pkgbuild git+https://github.com/fabpot/sphinx-php.git
[ERROR] : Python module not found: git+https://github.com/fabpot/sphinx-php.git
I attempted to use the tool to generate a PKGBUILD
file for a Python package that uses poetry for managing its dependencies, but the installation process failed with the following error message:
python: can't open file '/tmp/makepkg/name/src/name-0.1.0/setup.py': [Errno 2] No such file or directory
I believe this error is occurring because poetry uses pyproject.toml
instead of setup.py
to manage package metadata and dependencies.
I would like to request the support for poetry packages. This would make the tool more versatile and useful for users who rely on poetry to manage dependencies for their Python packages.
Thank you for your attention to this matter, and please let me know if you require any further information from me.
pip2pkgbuild pre-commit-mirror-maker
makepkg -fsi
will get
==> Making package: python-pre-commit-mirror-maker 1.9.0-1 (Sat 11 Mar 2023 12:37:43 AM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading pre-commit-mirror-maker-1.9.0.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (22) The requested URL returned error: 404
==> ERROR: Failure while downloading https://files.pythonhosted.org/packages/source/p/pre-commit-mirror-maker/pre-commit-mirror-maker-1.9.0.tar.gz
Aborting...
That is correct filename is https://files.pythonhosted.org/packages/source/p/pre-commit-mirror-maker/pre_commit_mirror_maker-1.9.0.tar.gz
.
See https://aur.archlinux.org/packages/python-pre-commit-mirror-maker.
I'm trying to create a PKGBUILD for my module from its directory; when I run
pip2pkgbuild yarsync
[ERROR] : Python module not found: yarsync
it gives that error. However, I installed the module on my system:
pip show yarsync
outputs its details.
Hi, thanks for the great tool, it saves a lot of time.
For two packages -- django-model-utils and django-secure -- however I'm encountering the following:
Traceback (most recent call last): File "/usr/bin/pip2pkgbuild", line 9, in <module> load_entry_point('pip2pkgbuild==0.1.4', 'console_scripts', 'pip2pkgbuild')() File "/usr/lib/python3.5/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 343, in main module = fetch_pymodule(args.module, args.module_version) File "/usr/lib/python3.5/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 291, in fetch_pymodule return PyModule(info) File "/usr/lib/python3.5/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 106, in __init__ self.license = self._get_license(info) File "/usr/lib/python3.5/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 124, in _get_license lambda recg: recg.lower() == info.get('license', '').lower()) File "/usr/lib/python3.5/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 121, in find_recognized return search_in_iter(recognized_licenses(), p) File "/usr/lib/python3.5/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 74, in search_in_iter if p(i): File "/usr/lib/python3.5/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 124, in <lambda> lambda recg: recg.lower() == info.get('license', '').lower()) AttributeError: 'NoneType' object has no attribute 'lower'
git clone https://aur.archlinux.org/packages/pip2pkgbuild
should be git clone https://aur.archlinux.org/pip2pkgbuild
Why did you declare your package as not-zip-safe?
cheers
hellerbarde
I love using pip2pkgbuild because I don't know much about PKGBUILD scripts myself. The one problem is that it always uses setup.py to build the package. making wheels with pip and installing as wheels from pip offers several advantages, including that the setup.py file never has root, compiled components can be distributed as binaries, modules ship with bytecode compiled and entry_points
generates much faster startup scripts.
It would be awesome if pip2pkgbuild supported this installation method!
This is needed for packaging.
You should probably be using SHA256SUMS in the PKGBUILD instead of MD5SUMS. MD5 is not suitable for package signatures anymore.
While it's all well and good to provide tooling for the usecases wanting python2
packages, most users are going to go for the default and not bother passing --pep517
. Swapping these defaults would help here.
Hi, I tried pip2pkgbuild open-interpreter && makepkg -si
but failed with the following error:
==> Making package: python-open-interpreter 0.1.15-1 (Tue 21 Nov 2023 08:41:32 AM JST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading open_interpreter-0.1.15.tar.gz...
==> Validating source files with sha256sums...
open_interpreter-0.1.15.tar.gz ... Passed
==> Extracting sources...
-> Extracting open_interpreter-0.1.15.tar.gz with bsdtar
==> Starting build()...
/home/yuki/.local/src/github.com/acomagu/pkgbuilds/open-interpreter/PKGBUILD: line 16: cd: /home/yuki/.local/src/github.com/acomagu/pkgbuilds/open-interpreter/src/open-interpreter-0.1.15: No such file or directory
==> ERROR: A failure occurred in build().
Aborting...
The generated PKGBUILD try to cd to src/open-interpreter-0.1.15
, but the correct path seems to be src/open_interpreter-0.1.15
.
I can fix it by rewriting PKGBUILD by hand, but I report. Thank you for awesome tool!
After RFC16, /usr/share/licenses/common/
has been replaced with /usr/share/licenses/spdx/{,exceptions}
.
Naturally, this gives rise to
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/licenses/common'
New makedepends (replace python-setuptools):
makedepends=('python-pip' 'python-wheel' 'python-flit' 'python-installer')
The new method is:
build() { cd "${srcdir}/${_module}-${pkgver}" python -m build --wheel --no-isolation } package() { depends+=() cd "${srcdir}/${_module}-${pkgver}" python -m installer --destdir="$pkgdir" dist/*.whl }
See this guideline:
https://wiki.archlinux.org/title/Python_package_guidelines#Installation_methods
The archlinux wiki recommends installing the license if available via adding install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
to the package()
functions.
This would require downloading an inspecting the compressed package itself to see whether a LICENSE
file exists, if so add the command above.
I'm getting this when I try to run pip2pkgbuild today:
Traceback (most recent call last):
File "/bin/pip2pkgbuild", line 11, in <module>
load_entry_point('pip2pkgbuild==0.2.3', 'console_scripts', 'pip2pkgbuild')()
File "/usr/lib/python3.6/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 591, in main
args.module, args.module_version, args.find_license)
File "/usr/lib/python3.6/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 525, in fetch_pymodule
raise e
File "/usr/lib/python3.6/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 513, in fetch_pymodule
info = fetch_json(url)
File "/usr/lib/python3.6/site-packages/pip2pkgbuild/pip2pkgbuild.py", line 509, in fetch_json
return json.loads(urlopen(url).read().decode('utf-8'))
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: SSL is required
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.