Update setup.py to enable pip installs direct from github #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Edit: Did a bit more work on this and rewrote the pull request description to be clearer
I've found that you can't install the uap-python library direct from github using pip or as a dependency for a project installed using setuptools.
There are 2 possible URLs that you can point pip/setup.py at:
git+https://github.com/ua-parser/uap-python.git@master#egg=ua-parser-0.4.0
https://github.com/ua-parser/uap-python/tarball/master#egg=ua-parser-0.4.0
There appears to be 2 issues:
I can't find a workaround/solution for the tarball download not including the submodule, it seems to be a limitation of the feature that github provides.
For the installation of the regexes files, I updated the setup.py (hence this pull request)
Test Methodology
wipeenv
from virtualenvwrapper to remove all installed python modules.python -c 'import ua_parser.user_agent_parser'
, which produces a traceback if the regexes aren't installed correctly.These are the tests cases I tried:
pip install <git_url>
pip install -e <git_url>
pip install <tarball_url>
pip install -e <tarball_url>
pip install --process-dependency-links . # (dependency_links=['<git_url>'])
pip install --process-dependency-links -e . # (dependency_links=['<git_url>'])
pip install --process-dependency-links . # (dependency_links=['<tarball_url>'])
pip install --process-dependency-links -e . # (dependency_links=['<tarball_url>'])
Test Results Using ua-parser/uap-python/master
git URL:
git+https://github.com/ua-parser/uap-python.git@master#egg=ua-parser-0.4.0
tarball URL:
https://github.com/ua-parser/uap-python/tarball/master#egg=ua-parser-0.4.0
Test Results Using crbunney/uap-python/fix_pip_install_from_source
git URL:
git+https://github.com/crbunney/uap-python.git@fix_pip_install_from_source#egg=ua-parser-0.4.0
tarball URL:
https://github.com/crbunney/uap-python/tarball/fix_pip_install_from_source#egg=ua-parser-0.4.0