Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed Sep 10, 2019
2 parents 7b13f00 + be03ab9 commit 25f02c5
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 101 deletions.
28 changes: 28 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
build: false

environment:
PYTHONIOENCODING: "UTF-8"

matrix:
- PYTHON: "C:/Python27-x64"
- PYTHON: "C:/Python35-x64"
- PYTHON: "C:/Python36-x64"
- PYTHON: "C:/Python37-x64"


install:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"

# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- "python -m pip install --disable-pip-version-check --user pip==18.1"

# Installing Poetry
- "python get-poetry.py --preview -y"
- "SET PATH=%USERPROFILE%\\.poetry\\bin;%PATH%"

# Install dependencies
- "poetry install -v"

test_script:
- "poetry run pytest --cov=poetry tests/ -W ignore"
96 changes: 0 additions & 96 deletions .github/workflows/main.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ repos:
rev: stable
hooks:
- id: black
language_version: python3.6
python_version: python3.6
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: python

stages:
- linting
- test

cache:
pip: true
directories:
- "$HOME/.cache/pypoetry"
- "$HOME/.cache/pre-commit"

install:
- pip install pip==18.1
- python get-poetry.py --preview -y
- source $HOME/.poetry/env
- poetry install -v

script: pytest -q tests/

jobs:
include:
- python: "2.7"
- python: "3.5"
- python: "3.6"
- python: "3.7"
dist: xenial

- stage: linting
python: "3.6"
install:
- pip install pre-commit
- pre-commit install-hooks
script:
- pre-commit run --all-files
3 changes: 3 additions & 0 deletions poetry/packages/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def to_pep_508(self, with_extras=True): # type: (bool) -> str
)

if markers:
if self.is_vcs():
requirement += " "

if len(markers) > 1:
markers = ["({})".format(m) for m in markers]
requirement += "; {}".format(" and ".join(markers))
Expand Down
8 changes: 4 additions & 4 deletions tests/masonry/builders/test_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def clear_samples_dist():


@pytest.mark.skipif(
sys.platform == "win32" and sys.version_info <= (3, 6),
reason="Disable test on Windows for Python <=3.6",
sys.platform == "win32" and sys.version_info <= (3, 4),
reason="Disable test on Windows for Python <=3.4",
)
def test_wheel_c_extension():
module_path = fixtures_dir / "extended"
Expand Down Expand Up @@ -96,8 +96,8 @@ def test_wheel_c_extension():


@pytest.mark.skipif(
sys.platform == "win32" and sys.version_info <= (3, 6),
reason="Disable test on Windows for Python <=3.6",
sys.platform == "win32" and sys.version_info <= (3, 4),
reason="Disable test on Windows for Python <=3.4",
)
def test_wheel_c_extension_src_layout():
module_path = fixtures_dir / "src_extended"
Expand Down
33 changes: 33 additions & 0 deletions tests/packages/test_vcs_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,36 @@ def test_to_pep_508_with_extras():
expected = "poetry[foo] @ git+https://github.com/sdispater/poetry.git@master"

assert expected == dependency.to_pep_508()


def test_to_pep_508_in_extras():
dependency = VCSDependency(
"poetry", "git", "https://github.com/sdispater/poetry.git"
)
dependency.in_extras.append("foo")

expected = (
'poetry @ git+https://github.com/sdispater/poetry.git@master ; extra == "foo"'
)
assert expected == dependency.to_pep_508()

dependency = VCSDependency(
"poetry", "git", "https://github.com/sdispater/poetry.git"
)
dependency.in_extras.append("foo")
dependency.extras.append("bar")

expected = 'poetry[bar] @ git+https://github.com/sdispater/poetry.git@master ; extra == "foo"'

assert expected == dependency.to_pep_508()

dependency = VCSDependency(
"poetry", "git", "https://github.com/sdispater/poetry.git", "b;ar;"
)
dependency.in_extras.append("foo;")

expected = (
'poetry @ git+https://github.com/sdispater/poetry.git@b;ar; ; extra == "foo;"'
)

assert expected == dependency.to_pep_508()

0 comments on commit 25f02c5

Please sign in to comment.