Merge pull request #12 from mayli/pip10

Avoid using pip internal function to make cachier work on pip>=10
This commit is contained in:
Shay Palachy
2019-01-29 12:36:56 +02:00
committed by GitHub
3 changed files with 7 additions and 15 deletions
+3 -1
View File
@@ -10,10 +10,12 @@ matrix:
sudo: true sudo: true
before_install: before_install:
# coverage submission packages # coverage submission packages
- pip install -U pip
- pip install -U pytest
- pip install codecov - pip install codecov
- pip install pymongo - pip install pymongo
install: install:
- if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then pip install pytest coverage pytest-cov .; else pip install ".[test]"; fi - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then pip install coverage pytest-cov .; else pip install ".[test]"; fi
script: python -m pytest --cov=cachier script: python -m pytest --cov=cachier
# submit coverage # submit coverage
after_success: after_success:
+1 -12
View File
@@ -16,18 +16,7 @@ import os
from functools import wraps from functools import wraps
import datetime import datetime
try: # for asynchronous file uploads from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import ThreadPoolExecutor
except ImportError: # we're in python 2.x
import pip
PACKAGES = [
package.project_name
for package
in pip.get_installed_distributions()
]
if 'futures' not in PACKAGES:
pip.main(['install', 'futures'])
from concurrent.futures import ThreadPoolExecutor
from .pickle_core import _PickleCore from .pickle_core import _PickleCore
from .mongo_core import _MongoCore, RecalculationNeeded from .mongo_core import _MongoCore, RecalculationNeeded
+3 -2
View File
@@ -38,10 +38,11 @@ setup(
cachier=cachier.scripts.cli:cli cachier=cachier.scripts.cli:cli
''', ''',
install_requires=[ install_requires=[
'watchdog', 'portalocker' 'watchdog', 'portalocker',
], ],
extras_require={ extras_require={
'test': TEST_REQUIRES 'test': TEST_REQUIRES,
':python_version == "2.7"': ['futures'],
}, },
platforms=['linux', 'osx', 'windows'], platforms=['linux', 'osx', 'windows'],
keywords=['cache', 'persistence', 'mongo', 'memoization', 'decorator'], keywords=['cache', 'persistence', 'mongo', 'memoization', 'decorator'],