Skip to content

Commit

Permalink
Attempt to solve dependency resolution with Pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Aug 17, 2020
1 parent 3949c6b commit f012ef6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/pyscaffold/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ def get_setup_requires_version():
Returns:
str: requirement string for setup_requires
"""
require_str = "pyscaffold>={major}.{minor}a0,<{major}.{next_minor}a0"
require_str = "pyscaffold>={major}.{minor}a0,<{next_major}"
major, minor, *rest = parse_version(pyscaffold_version).base_version.split(".")
next_minor = int(minor) + 1
return require_str.format(major=major, minor=minor, next_minor=next_minor)
next_major = int(major) + 1
return require_str.format(major=major, minor=minor, next_major=next_major)


def localize_path(path_string):
Expand Down
9 changes: 8 additions & 1 deletion tests/system/test_dependency_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest

from pyscaffold import __version__ as pyscaffold_version
from pyscaffold.api import create_project

pytestmark = [pytest.mark.slow, pytest.mark.system]
Expand Down Expand Up @@ -40,12 +41,18 @@ def test_pipenv_works_with_pyscaffold(cwd, venv_path, venv_run):
# Given a project is created with pyscaffold
# and it has some dependencies in setup.cfg
create_project(project="myproj", requirements=["appdirs"])

if any(ch in pyscaffold_version for ch in ("b", "a", "pre", "rc")):
flags = "--pre"
else:
flags = ""

with cwd.join("myproj").as_cwd():
# When we install pipenv,
venv_run("pip install -v pipenv")
venv_run("pipenv --bare install certifi")
# use it to proxy setup.cfg
venv_run("pipenv --bare install -e .")
venv_run("pipenv --bare install {} -e .".format(flags))
# and install things to the dev env,
venv_run("pipenv --bare install --dev flake8")

Expand Down

0 comments on commit f012ef6

Please sign in to comment.