Skip to content

Commit

Permalink
Update requirements with latest pip-tools release and downgrade a bit…
Browse files Browse the repository at this point in the history
… pip so we overcome the pip-tools#853 issue.
  • Loading branch information
hartym committed Sep 10, 2019
1 parent e06fe8b commit 3271297
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 78 deletions.
8 changes: 4 additions & 4 deletions Makefile
@@ -1,4 +1,4 @@
# Generated by Medikit 0.7.3 on 2019-06-30.
# Generated by Medikit 0.7.3 on 2019-09-10.
# All changes will be overriden.
# Edit Projectfile and run “make update” (or “medikit update”) to regenerate.

Expand Down Expand Up @@ -41,7 +41,7 @@ else ifneq ($(QUICK),)
@printf "Skipping \033[36m%s\033[0m because \033[36m$$QUICK\033[0m is not empty.\n" $(target)
else
@printf "Applying \033[36m%s\033[0m target...\n" $(target)
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ~=19.0" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ~=19.0,<19.2" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U $(PYTHON_REQUIREMENTS_INLINE) -r $(PYTHON_REQUIREMENTS_FILE)
@mkdir -p .medikit; touch $@
endif
Expand All @@ -59,7 +59,7 @@ else ifneq ($(QUICK),)
@printf "Skipping \033[36m%s\033[0m because \033[36m$$QUICK\033[0m is not empty.\n" $(target)
else
@printf "Applying \033[36m%s\033[0m target...\n" $(target)
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ~=19.0" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ~=19.0,<19.2" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U $(PYTHON_REQUIREMENTS_DEV_INLINE) -r $(PYTHON_REQUIREMENTS_DEV_FILE)
@mkdir -p .medikit; touch $@
endif
Expand All @@ -84,7 +84,7 @@ release: medikit ## Runs the "release" pipeline.
$(MEDIKIT) pipeline release start

medikit: # Checks installed medikit version and updates it if it is outdated.
@$(PYTHON) -c 'import medikit, pip, sys; from packaging.version import Version; sys.exit(0 if (Version(medikit.__version__) >= Version("$(MEDIKIT_VERSION)")) and (Version(pip.__version__) < Version("10")) else 1)' || $(PYTHON) -m pip install -U "pip ~=19.0" "medikit>=$(MEDIKIT_VERSION)"
@$(PYTHON) -c 'import medikit, pip, sys; from packaging.version import Version; sys.exit(0 if (Version(medikit.__version__) >= Version("$(MEDIKIT_VERSION)")) and (Version(pip.__version__) < Version("10")) else 1)' || $(PYTHON) -m pip install -U "pip ~=19.0,<19.2" "medikit>=$(MEDIKIT_VERSION)"

update: medikit ## Update project artifacts using medikit.
$(MEDIKIT) update $(MEDIKIT_UPDATE_OPTIONS)
Expand Down
9 changes: 5 additions & 4 deletions Projectfile
Expand Up @@ -45,11 +45,12 @@ python.setup(
},
)
python.add_requirements(
"git-semver ~=0.2.0",
"jinja2 ~=2.9",
"mondrian ~=0.7",
"git-semver ~=0.3",
"jinja2 ~=2.10",
"mondrian ~=0.8",
"packaging ~=19.0",
"pip-tools ~=3.0",
"pip-tools ~=4.0",
"semantic-version ~=2.8",
"stevedore ~=1.28",
"whistle ~=1.0",
"yapf ~=0.20",
Expand Down
2 changes: 1 addition & 1 deletion medikit/_version.py
@@ -1 +1 @@
__version__ = '0.7.3'
__version__ = "0.7.3"
8 changes: 2 additions & 6 deletions medikit/feature/python.py
Expand Up @@ -38,7 +38,6 @@
from piptools._compat import parse_requirements
from piptools.repositories import PyPIRepository
from piptools.resolver import Resolver
from piptools.scripts.compile import get_pip_command
from piptools.utils import format_requirement

import medikit
Expand Down Expand Up @@ -443,10 +442,7 @@ def on_end(self, event):
python_config = event.config["python"]

# Pip / PyPI
pip_command = get_pip_command()
pip_options, _ = pip_command.parse_args([])
session = pip_command._build_session(pip_options)
repository = PyPIRepository(pip_options, session)
repository = PyPIRepository([])

for extra in itertools.chain((None,), python_config.get_extras()):
requirements_file = "requirements{}.txt".format("-" + extra if extra else "")
Expand All @@ -460,7 +456,7 @@ def on_end(self, event):
tmpfile.flush()
constraints = list(
parse_requirements(
tmpfile.name, finder=repository.finder, session=repository.session, options=pip_options
tmpfile.name, finder=repository.finder, session=repository.session, options=repository.options
)
)
resolver = Resolver(constraints, repository, prereleases=False, clear_caches=False, allow_unsafe=False)
Expand Down
2 changes: 1 addition & 1 deletion medikit/globals.py
@@ -1,2 +1,2 @@
PIP_VERSION = "~=19.0"
PIP_VERSION = "~=19.0,<19.2"
LINE_LENGTH = "120"
22 changes: 11 additions & 11 deletions requirements-dev.txt
Expand Up @@ -6,31 +6,31 @@ attrs==19.1.0
babel==2.7.0
certifi==2019.6.16
chardet==3.0.4
coverage==4.5.3
docutils==0.14
coverage==4.5.4
docutils==0.15.2
idna==2.8
imagesize==1.1.0
importlib-metadata==0.18
importlib-metadata==0.21
isort==4.3.21
jinja2==2.10.1
markupsafe==1.1.1
more-itertools==7.1.0
packaging==19.0
more-itertools==7.2.0
packaging==19.1
pluggy==0.12.0
py==1.8.0
pygments==2.4.2
pyparsing==2.4.0
pyparsing==2.4.2
pytest-cov==2.7.1
pytest==5.0.0
pytz==2019.1
pytest==5.1.2
pytz==2019.2
releases==1.6.1
requests==2.22.0
semantic-version==2.6.0
semantic-version==2.8.2
six==1.12.0
snowballstemmer==1.9.0
snowballstemmer==1.9.1
sphinx-sitemap==1.0.2
sphinx==1.7.9
sphinxcontrib-websupport==1.1.2
urllib3==1.25.3
wcwidth==0.1.7
zipp==0.5.1
zipp==0.6.0
19 changes: 10 additions & 9 deletions requirements.txt
@@ -1,19 +1,20 @@
-e .
attrs==19.1.0
click==7.0
colorama==0.3.9
git-semver==0.2.4
git-semver==0.3.0
gitdb2==2.0.5
gitpython==2.1.11
gitpython==2.1.14
jinja2==2.10.1
markupsafe==1.1.1
mondrian==0.8.0
packaging==19.0
pbr==5.3.1
pip-tools==3.8.0
pyparsing==2.4.0
semantic-version==2.6.0
packaging==19.1
pbr==5.4.3
pip-tools==4.1.0
pyparsing==2.4.2
semantic-version==2.8.2
six==1.12.0
smmap2==2.0.5
stevedore==1.30.1
stevedore==1.31.0
whistle==1.0.1
yapf==0.27.0
yapf==0.28.0
94 changes: 52 additions & 42 deletions setup.py
@@ -1,11 +1,12 @@
# Generated by Medikit 0.7.3 on 2019-06-30.
# Generated by Medikit 0.7.3 on 2019-09-10.
# All changes will be overriden.
# Edit Projectfile and run “make update” (or “medikit update”) to regenerate.

from setuptools import setup, find_packages
from codecs import open
from os import path

from setuptools import find_packages, setup

here = path.abspath(path.dirname(__file__))

# Py3 compatibility hacks, borrowed from IPython.
Expand All @@ -20,70 +21,79 @@ def execfile(fname, globs, locs=None):

# Get the long description from the README file
try:
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
except:
long_description = ''
long_description = ""

# Get the classifiers from the classifiers file
tolines = lambda c: list(filter(None, map(lambda s: s.strip(), c.split('\n'))))
tolines = lambda c: list(filter(None, map(lambda s: s.strip(), c.split("\n"))))
try:
with open(path.join(here, 'classifiers.txt'), encoding='utf-8') as f:
with open(path.join(here, "classifiers.txt"), encoding="utf-8") as f:
classifiers = tolines(f.read())
except:
classifiers = []

version_ns = {}
try:
execfile(path.join(here, 'medikit/_version.py'), version_ns)
execfile(path.join(here, "medikit/_version.py"), version_ns)
except EnvironmentError:
version = 'dev'
version = "dev"
else:
version = version_ns.get('__version__', 'dev')
version = version_ns.get("__version__", "dev")

setup(
author='Romain Dorgueil',
author_email='romain@dorgueil.net',
description='Opinionated python 3.5+ project management.',
license='Apache License, Version 2.0',
name='medikit',
python_requires='>=3.5',
author="Romain Dorgueil",
author_email="romain@dorgueil.net",
description="Opinionated python 3.5+ project management.",
license="Apache License, Version 2.0",
name="medikit",
python_requires=">=3.5",
version=version,
long_description=long_description,
classifiers=classifiers,
packages=find_packages(exclude=['ez_setup', 'example', 'test']),
packages=find_packages(exclude=["ez_setup", "example", "test"]),
include_package_data=True,
install_requires=[
'git-semver ~= 0.2.0', 'jinja2 ~= 2.9', 'mondrian ~= 0.7',
'packaging ~= 19.0', 'pip-tools ~= 3.0', 'stevedore ~= 1.28',
'whistle ~= 1.0', 'yapf ~= 0.20'
"git-semver ~= 0.3",
"jinja2 ~= 2.10",
"mondrian ~= 0.8",
"packaging ~= 19.0",
"pip-tools ~= 4.0",
"semantic-version ~= 2.8",
"stevedore ~= 1.28",
"whistle ~= 1.0",
"yapf ~= 0.20",
],
extras_require={
'dev': [
'coverage ~= 4.5', 'isort', 'pytest ~= 5.0', 'pytest-cov ~= 2.7',
'releases >= 1.6, < 1.7', 'sphinx ~= 1.7', 'sphinx-sitemap ~= 1.0'
"dev": [
"coverage ~= 4.5",
"isort",
"pytest ~= 5.0",
"pytest-cov ~= 2.7",
"releases >= 1.6, < 1.7",
"sphinx ~= 1.7",
"sphinx-sitemap ~= 1.0",
]
},
entry_points={
'console_scripts': ['medikit=medikit.__main__:main'],
'medikit.feature': [
'django = medikit.feature.django:DjangoFeature',
'docker = medikit.feature.docker:DockerFeature',
'format = medikit.feature.format:FormatFeature',
'git = medikit.feature.git:GitFeature',
'kube = medikit.feature.kube:KubeFeature',
'make = medikit.feature.make:MakeFeature',
'nodejs = medikit.feature.nodejs:NodeJSFeature',
'pylint = medikit.feature.pylint:PylintFeature',
'pytest = medikit.feature.pytest:PytestFeature',
'python = medikit.feature.python:PythonFeature',
'sphinx = medikit.feature.sphinx:SphinxFeature',
'webpack = medikit.feature.webpack:WebpackFeature',
'yapf = medikit.feature.yapf:YapfFeature'
]
"console_scripts": ["medikit=medikit.__main__:main"],
"medikit.feature": [
"django = medikit.feature.django:DjangoFeature",
"docker = medikit.feature.docker:DockerFeature",
"format = medikit.feature.format:FormatFeature",
"git = medikit.feature.git:GitFeature",
"kube = medikit.feature.kube:KubeFeature",
"make = medikit.feature.make:MakeFeature",
"nodejs = medikit.feature.nodejs:NodeJSFeature",
"pylint = medikit.feature.pylint:PylintFeature",
"pytest = medikit.feature.pytest:PytestFeature",
"python = medikit.feature.python:PythonFeature",
"sphinx = medikit.feature.sphinx:SphinxFeature",
"webpack = medikit.feature.webpack:WebpackFeature",
"yapf = medikit.feature.yapf:YapfFeature",
],
},
url='https://python-medikit.github.io/',
download_url=
'https://github.com/python-medikit/medikit/archive/{version}.tar.gz'.
format(version=version),
url="https://python-medikit.github.io/",
download_url="https://github.com/python-medikit/medikit/archive/{version}.tar.gz".format(version=version),
)

0 comments on commit 3271297

Please sign in to comment.