Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ddelange/python-magic
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d672b91f7277d7fb024a35d4457d8243d91014d1
Choose a base ref
..
head repository: ddelange/python-magic
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 14f7dbbd65dd5bd103089f2117211b1797d5a2d3
Choose a head ref
Showing with 6 additions and 2 deletions.
  1. +1 −1 Makefile
  2. +5 −1 setup.py
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ install_libmagic:
( ( ( brew install libmagic || ( apt-get update && apt-get install -y libmagic1 ) ) || apk add --update libmagic ) || yum install file-libs ) || ( python -c 'import platform, sysconfig, io, zipfile, urllib.request; assert platform.system() == "Windows"; machine = "x86" if sysconfig.get_platform() == "win32" else "x64"; print(machine); zipfile.ZipFile(io.BytesIO(urllib.request.urlopen(f"https://github.com/julian-r/file-windows/releases/download/v5.44/file_5.44-build104-vs2022-{machine}.zip").read())).extractall(".")' && ls -ltra )
# on cibuildwheel, the lib needs to exist in the project before running setup.py
python -c "import subprocess; from magic.loader import load_lib; lib = load_lib()._name; print(f'linking {lib}'); subprocess.check_call(['cp', lib, 'magic'])"
cp /usr/share/misc/magic.mgc magic || true # only on linux
cp /usr/share/misc/magic /usr/share/misc/magic.mgc magic || true # only on linux
ls -ltra magic

.DEFAULT_GOAL := help
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -48,7 +48,11 @@ def get_tag(self):
long_description=read('README.md'),
long_description_content_type='text/markdown',
packages=['magic'],
package_data={'magic': ['py.typed', '*.pyi', '*.dylib*', '*.dll', '*.so*', 'magic.mgc']},
package_data={
'magic': [
'py.typed', '*.pyi', '*.dylib*', '*.dll', '*.so*', 'magic', 'magic.mgc'
]
},
cmdclass=cmdclass,
keywords="mime magic file",
license="MIT",