diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000000..c00f2dc5cec --- /dev/null +++ b/.appveyor.yml @@ -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" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index fc2ede99016..00000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Tests - -on: [push] - -jobs: - Linting: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Linting - run: | - pip install pre-commit - pre-commit run --all-files - - Linux: - needs: Linting - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [2.7, 3.5, 3.6, 3.7] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install Poetry - run: | - python get-poetry.py --preview -y - source $HOME/.poetry/env - - name: Install dependencies - run: | - source $HOME/.poetry/env - poetry install - - name: Test - run: | - source $HOME/.poetry/env - poetry run pytest -q tests - - MacOS: - needs: Linting - runs-on: macos-latest - strategy: - matrix: - python-version: [2.7, 3.5, 3.6, 3.7] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install Poetry - run: | - python get-poetry.py --preview -y - source $HOME/.poetry/env - - name: Install dependencies - run: | - source $HOME/.poetry/env - poetry install - - name: Test - run: | - source $HOME/.poetry/env - poetry run pytest -q tests - - Windows: - needs: Linting - runs-on: windows-latest - strategy: - matrix: - python-version: [2.7, 3.5, 3.6, 3.7] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install Poetry - run: | - python get-poetry.py --preview -y - SET PATH=%USERPROFILE%\\.poetry\\bin;%PATH% - - name: Install dependencies - run: | - SET PATH=%USERPROFILE%\\.poetry\\bin;%PATH% - poetry install - - name: Test - run: | - SET PATH=%USERPROFILE%\\.poetry\\bin;%PATH% - poetry run pytest -q tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b9a75affdb4..6b719683f29 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,4 +3,4 @@ repos: rev: stable hooks: - id: black - language_version: python3.6 + python_version: python3.6 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..e1bba9a92ce --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/poetry/packages/dependency.py b/poetry/packages/dependency.py index f58ef1ae1d8..b98b6fb35b8 100644 --- a/poetry/packages/dependency.py +++ b/poetry/packages/dependency.py @@ -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)) diff --git a/tests/masonry/builders/test_complete.py b/tests/masonry/builders/test_complete.py index d12aec2add3..06e043c5d3b 100644 --- a/tests/masonry/builders/test_complete.py +++ b/tests/masonry/builders/test_complete.py @@ -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" @@ -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" diff --git a/tests/packages/test_vcs_dependency.py b/tests/packages/test_vcs_dependency.py index 18e3e978d80..9872a443a7c 100644 --- a/tests/packages/test_vcs_dependency.py +++ b/tests/packages/test_vcs_dependency.py @@ -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()