Comments (10)
How are you building with pip? I do pip install -e .
routinely and had no issue with it.
from brotli.
I know, but that only runs python setup develop
for testing a package while developing it.
The problem arises when doing pip install .
, without the -e
option.
If you look at the traceback, the reason why pip fails is because it cannot find the C/C++ sources, since they are referenced using a relative path which is "above" the setup.py working directory:
$ pip install .
Processing /Users/cosimolupo/Documents/Github/brotli/python
Installing collected packages: Brotli
Running setup.py install for Brotli
clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DOS_MACOSX=1 -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/dec/bit_reader.c -o build/temp.macosx-10.9-x86_64-2.7/private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/dec/bit_reader.o
clang: error: no such file or directory: '/private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/dec/bit_reader.c'
clang: error: no input files
error: command 'clang' failed with exit status 1
Complete output from command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/pip-oaQuzp-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/pip-R4EIB0-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
creating build
creating build/temp.macosx-10.9-x86_64-2.7
creating build/temp.macosx-10.9-x86_64-2.7/private
creating build/temp.macosx-10.9-x86_64-2.7/private/var
creating build/temp.macosx-10.9-x86_64-2.7/private/var/folders
creating build/temp.macosx-10.9-x86_64-2.7/private/var/folders/1w
creating build/temp.macosx-10.9-x86_64-2.7/private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn
creating build/temp.macosx-10.9-x86_64-2.7/private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T
creating build/temp.macosx-10.9-x86_64-2.7/private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/dec
clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DOS_MACOSX=1 -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/dec/bit_reader.c -o build/temp.macosx-10.9-x86_64-2.7/private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/dec/bit_reader.o
clang: error: no such file or directory: '/private/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/dec/bit_reader.c'
clang: error: no input files
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/pip-oaQuzp-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/pip-R4EIB0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/1w/6098jtks69sgwz0vtz2ysmsm0000gn/T/pip-oaQuzp-build
from brotli.
I think we need to fix sdist
command, since it seems not to copy any of the Brotli source files. If this does not fix pip
, it will at least allow uploading to PyPI.
from brotli.
I'll have look at sdist.
The thing is, the way pip (but also distutils, setuptools, etc.) expects python packages to be organised is with a setup.py at the root of the package, and then everything else positioned either on the same level or inside sub-folders reachable from the root. Whereas here we want to keep the python folder isolated from the C/C++ source files, which is understandable, but this seems to conflict with the way Python packaging works. Maybe the solution could simply be to clone brotli as a submodule in another repository with a copy of setup.py positioned higher in the directory tree.
from brotli.
Maybe the solution could simply be to clone brotli as a submodule in another repository with a copy of setup.py positioned higher in the directory tree.
That is how it was done originally :)
from brotli.
yes, I do remember.
from brotli.
Thinking about it more, I think it shouldn’t harm to move the setup.py file to the top level directory, and leave the C file where it is, if it will simplify things.
from brotli.
It would definitely make the Python extension's setup much easier.
On Tue, Mar 31, 2015 at 8:42 AM, Khaled Hosny [email protected]
wrote:
Thinking about it more, I think it shouldn’t harm to move the setup.py file to the top level directory, and leave the C file where it is, if it will simplify things.
Reply to this email directly or view it on GitHub:
#52 (comment)
from brotli.
If it involves just the setup.py file, it should be ok to have it in the top-level directory.
from brotli.
I can confirm pip is happy after 5e3e97e
from brotli.
Related Issues (20)
- Brotli wheel for arm64 HOT 3
- How to compress utf-16 string and decompress? HOT 4
- using brotli compression on embedded iot with limited RAM HOT 1
- BrotliInputStream.java issue when using both read() followed by read(byte b[]) HOT 5
- mode_generic & dictionary sharing HOT 1
- (windows) JNI makefile
- JavaScript throws Corrupted reserved bit HOT 6
- OSS-Fuzz issue 60394 HOT 1
- Ability to clone/serialize/deserialize state in Compressor and Decompressor HOT 4
- Exception while brotliDecode in decode.ts HOT 5
- EMPTY VERSION FIELDS IN PKGCONFIG FILES (LINUX) HOT 4
- Support for user-supplied dictionaries in Python binding
- Release v1.1 HOT 14
- Publish JNI artefacts (including platform-dependent) HOT 7
- Stale comment referring to nonexisting WriteMetadata() function HOT 6
- v1.1.0rc does not build on macOS 10.12.6 HOT 8
- Strange compression ratio on large CSV file... HOT 1
- Brotli v1.1.0 tests fail with pypy3 HOT 10
- Brotli 1.1.0 breaks Python 2 compatibility HOT 3
- Create a static source tarball for releases
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 brotli.