-
Notifications
You must be signed in to change notification settings - Fork 965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MameToolkit #6197
Comments
Looking at https://pypi.org/project/MAMEToolkit/#files, there seem to be some issues with the metadata. There are two files uploaded:
Both archives include the (199MB, once unpacked) native executable file:
The The There's a solution though: distribute manylinux wheels: these are wheels whose filename ends in something like But there's a small catch. One of the issues with distributing native binaries for Linux is the variety of shared libraries that are installed on individual platforms. The distributed
The manylinux1 and manylinux2010 specifications outline a list of shared libraries that are safe to link to that enable the binary to work an a large variety of Linux systems. Many of the libraries linked to by this binary are not on that list, so this binary is unlikely to work on systems other than exactly the one that compiled it (or very close cousins). There's a solution to that too: the manylinux project provides tools and examples to build wheels that include the required shared libraries so that the binary can work on most Linux systems. I think an appropriate tag for the existing wheel would be something like Would you be interested in updating your distributions (removing platform-specific compiled binaries from the source distribution, and either making the binary wheel manylinux-compliant or not distributing a binary wheel)? |
Thank you Jason, this is extremely helpful. I wasn't aware that I had incorrectly configured the project. I will definitely make the appropriate changes. Once the fixes are made, would you be able to increase my data limit? |
Great! Glad I could help.
I'm not aware of any reason not to! It might be a good idea to close this issue and open a new one when the packaging is ready. We try not to, but sometimes older issues get lost in the backlog. |
Hello Again, I'm having a lot of issues trying exclude the mame binary from the tar.gz. I can only seem to exclude files from the whl or both, but not from the tar.gz using setuptools. How do I state which files go into which compressed file using setuptools? |
Because you're essentially building a native code extension, I think you need to tell setuptools about that so that it knows what is source and what is built code. Ideally, we would use the setuptools functionality to actually build the compiled file and include its sources in our sdist. We could potentially piggyback on the If we expect to have the compiled file already built completely outside of the setuptools lifecyle, though, there's an easier, if hacky way by overriding the default NOTE: This is from by own experience with setuptools, not an endorsement of this being the "right" or "official" way to do things. NOTE: This doesn't handle making the built binary manylinux1 compatible. The built binary is still system specific and this wheel won't be accepted for upload by PyPI. Given this directory layout: $ ls -R
.:
README.rst binary setup.cfg setup.py src
./binary:
binary
./src:
package
./src/package:
__init__.py binary module.py
./src/package/binary:
__init__.py We have a built binary file at Given this [bdist_wheel]
python-tag = py3
plat-name = linux_x86_64 We can write this minimum import shutil
import os
from setuptools import setup
from setuptools import find_packages
from setuptools.command.build_py import build_py as orig_build
version = '1.0.0.dev0'
# A hacky way to build our executable dependency,
# treating it like a C library, by copying a built
# binary.
# Ideally this would actually build the executable.
class build(orig_build):
def run(self):
orig_build.run(self)
binary_file = os.path.join('binary', 'binary')
if os.path.exists(binary_file):
# Hardcoding the destination within our package structure.
dest_dir = os.path.join(self.build_lib, 'package', 'binary')
if not os.path.isdir(dest_dir):
os.makedirs(dest_dir)
shutil.copy(binary_file, dest_dir)
setup(
name='package',
version=version,
url="https://example.com",
author="You",
author_email="you@example.com",
zip_safe=False,
packages=find_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
cmdclass={
'build_py': build,
},
) Building the wheel gets the binary file: $ python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
...
removing build/bdist.macosx-10.14-x86_64/wheel
$ unzip -l dist/package-1.0.0.dev0-py3-none-linux_x86_64.whl
Archive: dist/package-1.0.0.dev0-py3-none-linux_x86_64.whl
Length Date Time Name
--------- ---------- ----- ----
0 07-17-2019 10:58 package/__init__.py
0 07-17-2019 10:58 package/module.py
0 07-17-2019 10:59 package/binary/__init__.py
0 07-17-2019 12:14 package/binary/binary
192 07-17-2019 12:14 package-1.0.0.dev0.dist-info/METADATA
101 07-17-2019 12:14 package-1.0.0.dev0.dist-info/WHEEL
8 07-17-2019 12:14 package-1.0.0.dev0.dist-info/top_level.txt
616 07-17-2019 12:14 package-1.0.0.dev0.dist-info/RECORD
--------- -------
917 8 files Build the sdist does not:
|
Hello Jason, Thank you for providing such amazing in depth advice. It saved me a lot of time and effort, I wasn't aware of any of this. I really appreciate it, you are awesome! Sorry it took so long, my ubuntu died after a dist-upgrade. Could you review the changes and let me know if this is suitable for the size limit change? |
Will move to new issue. |
Hello,
I would like to increase the size of my pypi repository from 60MB to 120MB (https://pypi.org/project/MAMEToolkit/#files).
I have to include a pre-compiled instance of MAME inside my repository for my code to work. I have just recompiled a newer instance of the library, and the size has increased, so the entire code is now 101MB. 120MB would be a safe padding.
Yours faithfully,
Michael Murray
The text was updated successfully, but these errors were encountered: