Skip to content

Commit

Permalink
Upgraded pip and pip-tools to latest stable versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
hartym committed Mar 15, 2019
1 parent 83d78ec commit a6eda8c
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 55 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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 ~=18.0" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ~=19.0" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U $(PYTHON_REQUIREMENTS_INLINE) -r $(PYTHON_REQUIREMENTS_FILE)
@mkdir -p .medikit; touch $@
endif
Expand All @@ -57,7 +57,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 ~=18.0" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ~=19.0" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U $(PYTHON_REQUIREMENTS_DEV_INLINE) -r $(PYTHON_REQUIREMENTS_DEV_FILE)
@mkdir -p .medikit; touch $@
endif
Expand All @@ -82,7 +82,7 @@ format: ## Reformats the whole codebase using our standards (requires black an
$(ISORT) -rc -o mondrian -o whistle -y .

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 ~=18.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" "medikit>=$(MEDIKIT_VERSION)"

update: medikit ## Update project artifacts using medikit.
$(MEDIKIT) update $(MEDIKIT_UPDATE_OPTIONS)
Expand Down
2 changes: 1 addition & 1 deletion Projectfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ python.add_requirements(
"jinja2 ~=2.9",
"mondrian ~=0.7",
"packaging ~=19.0",
"pip-tools ~=2.0.2",
"pip-tools ~=3.0",
"stevedore ~=1.28",
"whistle ~=1.0",
"yapf ~=0.20",
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

- :release:`0.8.0 <soon>`
- :feature:`0` Python: Upgraded to pip 19.x.
- :feature:`0` Python: Upgraded to pip-tools 3.x.
- :release:`0.7.0 <2019-03-15>`
- :feature:`0` Git: now less verbose.
- :feature:`0` Kubernetes: basic helm support.
Expand Down
2 changes: 1 addition & 1 deletion medikit/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.7.0'
__version__ = "0.7.0"
5 changes: 3 additions & 2 deletions medikit/feature/make/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from medikit.feature.make.events import MakefileEvent
from medikit.feature.make.resources import MakefileTarget, Makefile, InstallScript, CleanScript
from medikit.feature.make.utils import which
from medikit.globals import PIP_VERSION
from medikit.structs import Script

__all__ = [
Expand Down Expand Up @@ -89,8 +90,8 @@ def add_medikit_targets(self, config):

self.makefile.add_target(
"medikit",
'@$(PYTHON) -c {!r} || $(PYTHON) -m pip install -U "pip ~=18.0" "medikit>=$(MEDIKIT_VERSION)"'.format(
"; ".join(source)
'@$(PYTHON) -c {!r} || $(PYTHON) -m pip install -U "pip {PIP_VERSION}" "medikit>=$(MEDIKIT_VERSION)"'.format(
"; ".join(source), PIP_VERSION=PIP_VERSION
),
phony=True,
hidden=True,
Expand Down
11 changes: 7 additions & 4 deletions medikit/feature/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
import tempfile
from getpass import getuser

from piptools._vendored.pip._vendor.distlib.util import parse_requirement
from piptools._vendored.pip.req import parse_requirements
from pip._vendor.distlib.util import parse_requirement
from piptools._compat import parse_requirements
from piptools.repositories import PyPIRepository
from piptools.resolver import Resolver
from piptools.scripts.compile import get_pip_command
Expand All @@ -44,6 +44,7 @@
from medikit.events import subscribe
from medikit.feature import ABSOLUTE_PRIORITY, Feature
from medikit.feature.make import InstallScript, which
from medikit.globals import PIP_VERSION
from medikit.utils import get_override_warning_banner


Expand Down Expand Up @@ -297,7 +298,9 @@ def _get_install_commands(extra=None):
return [
"$(PIP) install $(PIP_INSTALL_OPTIONS) "
+ _get_wheelhouse_options(extra=extra)
+ ' -U "pip ~=18.0" wheel',
+ ' -U "pip '
+ PIP_VERSION
+ '" wheel',
"$(PIP) install $(PIP_INSTALL_OPTIONS) "
+ _get_wheelhouse_options(extra=extra)
+ " -U $("
Expand Down Expand Up @@ -340,7 +343,7 @@ def _get_install_deps(extra=None):

def _get_install_commands(extra=None):
return [
'$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ~=18.0" wheel',
'$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip ' + PIP_VERSION + '" wheel',
"$(PIP) install $(PIP_INSTALL_OPTIONS) -U $("
+ _get_reqs_inline_varname(extra=extra)
+ ") -r $("
Expand Down
1 change: 1 addition & 0 deletions medikit/globals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PIP_VERSION = "~=19.0"
3 changes: 2 additions & 1 deletion medikit/steps/install.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import sys

from medikit.globals import PIP_VERSION
from medikit.steps.exec import System


class Install(System):
def __init__(self, *packages):
if not len(packages):
packages = ("pip ~=18.0", "wheel", "twine")
packages = ("pip " + PIP_VERSION, "wheel", "twine")
packages = list(sorted(packages))
super().__init__(sys.executable + " -m pip install --upgrade " + " ".join(map(repr, packages)))
self.__args__ = (*packages,)
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-e .
click==7.0
colorama==0.3.9
first==2.0.2
git-semver==0.2.3
gitdb2==2.0.5
gitpython==2.1.11
Expand All @@ -10,7 +9,7 @@ markupsafe==1.1.1
mondrian==0.8.0
packaging==19.0
pbr==5.1.3
pip-tools==2.0.2
pip-tools==3.5.0
pyparsing==2.3.1
semantic-version==2.6.0
six==1.12.0
Expand Down
89 changes: 48 additions & 41 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# 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,76 @@ 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.3)', 'jinja2 (~= 2.9)', 'mondrian (~= 0.7)',
'packaging (~= 19.0)', 'pip-tools (~= 2.0.2)', 'stevedore (~= 1.28)',
'whistle (~= 1.0)', 'yapf (~= 0.20)'
"git-semver ~= 0.2.3",
"jinja2 ~= 2.9",
"mondrian ~= 0.7",
"packaging ~= 19.0",
"pip-tools ~= 3.0",
"stevedore ~= 1.28",
"whistle ~= 1.0",
"yapf ~= 0.20",
],
extras_require={
'dev': [
'coverage (~= 4.4)', 'pytest (~= 3.4)', 'pytest-cov (~= 2.5)',
'releases (>= 1.6, < 1.7)', 'sphinx (~= 1.7)',
'sphinx-sitemap (~= 1.0)'
"dev": [
"coverage ~= 4.4",
"pytest ~= 3.4",
"pytest-cov ~= 2.5",
"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',
'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",
"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 a6eda8c

Please sign in to comment.