diff --git a/.cirrus.yml b/.cirrus.yml index 95e67bb0a09..2a1c443a7bc 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,24 +1,29 @@ freebsd_instance: - image_family: freebsd-12-2 + image_family: freebsd-13-0 test_task: name: "Tests / FreeBSD / " only_if: $CIRRUS_TAG == '' skip: "!changesInclude('.cirrus.yml', 'poetry.lock', 'pyproject.toml', '**.json','**.py')" env: + PATH: /.local/bin:${PATH} matrix: - - PYTHON: python3.6 - PYTHON: python3.8 + - PYTHON: python3.9 python_script: - PYPACKAGE=$(printf '%s' $PYTHON | tr -d '.') - SQLPACKAGE=$(printf '%s-sqlite3' $PYPACKAGE | sed 's/thon//') - - pkg install -y git-lite $PYPACKAGE $SQLPACKAGE + - pkg install -y git-lite curl $PYPACKAGE $SQLPACKAGE pip_script: - $PYTHON -m ensurepip - - $PYTHON -m pip --disable-pip-version-check install -U pip tox virtualenv - - $PYTHON -m pip --disable-pip-version-check install -U --pre poetry + - $PYTHON -m pip --disable-pip-version-check install -U pip + poetry_script: + - curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \ + | $PYTHON - -y - poetry config virtualenvs.in-project true - tox_script: $PYTHON -m tox -e py -- -q --junitxml=junit.xml tests + test_script: | + poetry install + poetry run pytest -q --junitxml=junit.xml tests on_failure: annotate_failure_artifacts: path: junit.xml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..f4369a4054e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 + +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "monthly" + # keep dependency updates manual for now + open-pull-requests-limit: 0 + reviewers: + - "python-poetry/triage" diff --git a/README.md b/README.md index 9a456733b0d..e4ea02d9cad 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ There are some things we can notice here: * It will try to enforce [semantic versioning]() as the best practice in version naming. * You can specify the readme, included and excluded files: no more `MANIFEST.in`. `poetry` will also use VCS ignore files (like `.gitignore`) to populate the `exclude` section. -* Keywords (up to 5) can be specified and will act as tags on the packaging site. +* Keywords can be specified and will act as tags on the packaging site. * The dependencies sections support caret, tilde, wildcard, inequality and multiple requirements. * You must specify the python versions for which your package is compatible. diff --git a/docs/basic-usage.md b/docs/basic-usage.md index 15dafdeeada..fb20dee502b 100644 --- a/docs/basic-usage.md +++ b/docs/basic-usage.md @@ -74,7 +74,7 @@ pendulum = "^2.1" As you can see, it takes a mapping of **package names** and **version constraints**. Poetry uses this information to search for the right set of files in package "repositories" that you register -in the `tool.poetry.repositories` section, or on [PyPI](https://pypi.org) by default. +in the `tool.poetry.source` section, or on [PyPI](https://pypi.org) by default. Also, instead of modifying the `pyproject.toml` file by hand, you can use the `add` command. diff --git a/docs/managing-environments.md b/docs/managing-environments.md index d9b728825a1..deed3578467 100644 --- a/docs/managing-environments.md +++ b/docs/managing-environments.md @@ -30,12 +30,12 @@ to activate one explicitly, see [Switching environments](#switching-between-envi To easily switch between Python versions, it is recommended to use [pyenv](https://github.com/pyenv/pyenv) or similar tools. -For instance, if your project is Python 2.7 only, a standard workflow +For instance, if your project is Python 3.6 only, a standard workflow would be: ```bash -pyenv install 2.7.15 -pyenv local 2.7.15 # Activate Python 2.7 for the current project +pyenv install 3.6.15 +pyenv local 3.6.15 # Activate Python 3.6 for the current project poetry install ``` {{% /note %}} diff --git a/docs/pyproject.md b/docs/pyproject.md index d7e75daa6f8..a0d1c896f41 100644 --- a/docs/pyproject.md +++ b/docs/pyproject.md @@ -87,7 +87,7 @@ An URL to the documentation of the project. **Optional** ## keywords -A list of keywords (max: 5) that the package is related to. **Optional** +A list of keywords that the package is related to. **Optional** ## classifiers diff --git a/poetry/factory.py b/poetry/factory.py index 144bfe35871..03b55175cd4 100644 --- a/poetry/factory.py +++ b/poetry/factory.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from pathlib import Path from typing import TYPE_CHECKING from typing import Dict @@ -10,17 +7,16 @@ from cleo.io.io import IO from cleo.io.null_io import NullIO +from poetry.config.config import Config +from poetry.config.file_config_source import FileConfigSource from poetry.core.factory import Factory as BaseFactory from poetry.core.toml.file import TOMLFile - -from .config.config import Config -from .config.file_config_source import FileConfigSource -from .locations import CONFIG_DIR -from .packages.locker import Locker -from .packages.project_package import ProjectPackage -from .plugins.plugin_manager import PluginManager -from .poetry import Poetry -from .repositories.pypi_repository import PyPiRepository +from poetry.locations import CONFIG_DIR +from poetry.packages.locker import Locker +from poetry.packages.project_package import ProjectPackage +from poetry.plugins.plugin_manager import PluginManager +from poetry.poetry import Poetry +from poetry.repositories.pypi_repository import PyPiRepository if TYPE_CHECKING: diff --git a/poetry/masonry/builders/editable.py b/poetry/masonry/builders/editable.py index 52d42b8dab5..60c686844e6 100644 --- a/poetry/masonry/builders/editable.py +++ b/poetry/masonry/builders/editable.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import hashlib import os import shutil diff --git a/poetry/repositories/installed_repository.py b/poetry/repositories/installed_repository.py index e91e0bd3c9e..f5adbe0ac7b 100644 --- a/poetry/repositories/installed_repository.py +++ b/poetry/repositories/installed_repository.py @@ -63,11 +63,7 @@ def get_package_paths(cls, env: Env, name: str) -> Set[Path]: if line and not line.startswith(("#", "import ", "import\t")): path = Path(line) if not path.is_absolute(): - try: - path = lib.joinpath(path).resolve() - except FileNotFoundError: - # this is required to handle pathlib oddity on win32 python==3.5 - path = lib.joinpath(path) + path = lib.joinpath(path).resolve() paths.add(path) src_path = env.path / "src" / name diff --git a/sonnet b/sonnet index 70f2a5f5e74..aa91f132232 100755 --- a/sonnet +++ b/sonnet @@ -230,8 +230,6 @@ class MakeReleaseCommand(Command): subprocess.check_output( [python, "-V"], stderr=subprocess.STDOUT, shell=WINDOWS ) - if version == "3.4" and WINDOWS: - continue subprocess.check_output([python, "-m", "pip", "install", "pip", "-U"]) except subprocess.CalledProcessError: diff --git a/tests/console/commands/test_export.py b/tests/console/commands/test_export.py index 0c4efc2e45e..80b2f14f732 100644 --- a/tests/console/commands/test_export.py +++ b/tests/console/commands/test_export.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - import pytest from tests.helpers import get_package diff --git a/tests/fixtures/directory/project_with_transitive_directory_dependencies/setup.py b/tests/fixtures/directory/project_with_transitive_directory_dependencies/setup.py index 24a8f05be9f..cfce0806c30 100644 --- a/tests/fixtures/directory/project_with_transitive_directory_dependencies/setup.py +++ b/tests/fixtures/directory/project_with_transitive_directory_dependencies/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from distutils.core import setup packages = ["project_with_extras"] diff --git a/tests/fixtures/git/github.com/demo/demo/setup.py b/tests/fixtures/git/github.com/demo/demo/setup.py index faebbc83748..b6f6d0c1f8c 100644 --- a/tests/fixtures/git/github.com/demo/demo/setup.py +++ b/tests/fixtures/git/github.com/demo/demo/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from setuptools import setup diff --git a/tests/fixtures/git/github.com/demo/no-dependencies/setup.py b/tests/fixtures/git/github.com/demo/no-dependencies/setup.py index da86b53b2bb..099c69cf976 100644 --- a/tests/fixtures/git/github.com/demo/no-dependencies/setup.py +++ b/tests/fixtures/git/github.com/demo/no-dependencies/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from setuptools import setup diff --git a/tests/fixtures/git/github.com/demo/no-version/setup.py b/tests/fixtures/git/github.com/demo/no-version/setup.py index 4e1aea3034c..d14b308cb23 100644 --- a/tests/fixtures/git/github.com/demo/no-version/setup.py +++ b/tests/fixtures/git/github.com/demo/no-version/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import ast import os diff --git a/tests/fixtures/git/github.com/demo/non-canonical-name/setup.py b/tests/fixtures/git/github.com/demo/non-canonical-name/setup.py index 3e6da62e986..8004332d6d9 100644 --- a/tests/fixtures/git/github.com/demo/non-canonical-name/setup.py +++ b/tests/fixtures/git/github.com/demo/non-canonical-name/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from setuptools import setup diff --git a/tests/fixtures/project_with_setup/setup.py b/tests/fixtures/project_with_setup/setup.py index 0f9e0d095a0..c329347f9bb 100644 --- a/tests/fixtures/project_with_setup/setup.py +++ b/tests/fixtures/project_with_setup/setup.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from setuptools import setup diff --git a/tests/installation/test_executor.py b/tests/installation/test_executor.py index 9b7b413b92b..de3945661fd 100644 --- a/tests/installation/test_executor.py +++ b/tests/installation/test_executor.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - import json import re import shutil diff --git a/tests/installation/test_installer.py b/tests/installation/test_installer.py index e7deba08232..7625f07df2f 100644 --- a/tests/installation/test_installer.py +++ b/tests/installation/test_installer.py @@ -1,8 +1,5 @@ -from __future__ import unicode_literals - import itertools import json -import sys from pathlib import Path @@ -1751,11 +1748,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no expected = fixture("with-conditional-dependency") assert locker.written_data == expected - - if sys.version_info >= (3, 5, 0): - assert 1 == installer.executor.installations_count - else: - assert 0 == installer.executor.installations_count + assert 1 == installer.executor.installations_count def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency( diff --git a/tests/installation/test_installer_old.py b/tests/installation/test_installer_old.py index 0ce71122a7d..c4a41c34ad5 100644 --- a/tests/installation/test_installer_old.py +++ b/tests/installation/test_installer_old.py @@ -1,7 +1,4 @@ -from __future__ import unicode_literals - import itertools -import sys from pathlib import Path @@ -1447,11 +1444,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no assert locker.written_data == expected installs = installer.installer.installs - - if sys.version_info >= (3, 5, 0): - assert len(installs) == 1 - else: - assert len(installs) == 0 + assert len(installs) == 1 def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency( diff --git a/tests/masonry/builders/test_editable_builder.py b/tests/masonry/builders/test_editable_builder.py index 270b1d80c75..4cc2c6c8c6a 100644 --- a/tests/masonry/builders/test_editable_builder.py +++ b/tests/masonry/builders/test_editable_builder.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - import os import shutil diff --git a/tests/test_factory.py b/tests/test_factory.py index 072f7ebb01a..bb632cc9a26 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals - from pathlib import Path import pytest diff --git a/tests/utils/fixtures/setups/ansible/setup.py b/tests/utils/fixtures/setups/ansible/setup.py index 5d7d1f4ec60..7a3af3bf995 100644 --- a/tests/utils/fixtures/setups/ansible/setup.py +++ b/tests/utils/fixtures/setups/ansible/setup.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import json import os import os.path diff --git a/tests/utils/fixtures/setups/flask/setup.py b/tests/utils/fixtures/setups/flask/setup.py index 2117d7ccc0a..98801eb8dff 100644 --- a/tests/utils/fixtures/setups/flask/setup.py +++ b/tests/utils/fixtures/setups/flask/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- import io import re from collections import OrderedDict diff --git a/tests/utils/fixtures/setups/pendulum/setup.py b/tests/utils/fixtures/setups/pendulum/setup.py index 3a6323fbbdf..4dcbe961465 100644 --- a/tests/utils/fixtures/setups/pendulum/setup.py +++ b/tests/utils/fixtures/setups/pendulum/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from distutils.core import setup from build import * diff --git a/tests/utils/fixtures/setups/pyyaml/setup.py b/tests/utils/fixtures/setups/pyyaml/setup.py index 79ccc813263..682ff9186e4 100644 --- a/tests/utils/fixtures/setups/pyyaml/setup.py +++ b/tests/utils/fixtures/setups/pyyaml/setup.py @@ -308,10 +308,7 @@ def run(self): build_cmd = self.get_finalized_command("build") build_cmd.run() sys.path.insert(0, build_cmd.build_lib) - if sys.version_info[0] < 3: - sys.path.insert(0, "tests/lib") - else: - sys.path.insert(0, "tests/lib3") + sys.path.insert(0, "tests/lib3") import test_all if not test_all.main([]): @@ -337,7 +334,7 @@ def run(self): url=URL, download_url=DOWNLOAD_URL, classifiers=CLASSIFIERS, - package_dir={"": {2: "lib", 3: "lib3"}[sys.version_info[0]]}, + package_dir={"": "lib3"}, packages=["yaml"], ext_modules=[ Extension( diff --git a/tests/utils/fixtures/setups/sqlalchemy/setup.py b/tests/utils/fixtures/setups/sqlalchemy/setup.py index 8842a482d27..bc367a1d5d0 100644 --- a/tests/utils/fixtures/setups/sqlalchemy/setup.py +++ b/tests/utils/fixtures/setups/sqlalchemy/setup.py @@ -12,8 +12,6 @@ from setuptools.command.test import test as TestCommand cmdclass = {} -if sys.version_info < (2, 7): - raise Exception("SQLAlchemy requires Python 2.7 or higher.") cpython = platform.python_implementation() == "CPython" diff --git a/tests/utils/test_env.py b/tests/utils/test_env.py index 56acb063877..6366bb9a0e9 100644 --- a/tests/utils/test_env.py +++ b/tests/utils/test_env.py @@ -963,12 +963,7 @@ def test_env_system_packages(tmp_path, config): EnvManager(config).build_venv(path=venv_path, flags={"system-site-packages": True}) - if sys.version_info >= (3, 3): - assert "include-system-site-packages = true" in pyvenv_cfg.read_text() - elif (2, 6) < sys.version_info < (3, 0): - assert not venv_path.joinpath( - "lib", "python2.7", "no-global-site-packages.txt" - ).exists() + assert "include-system-site-packages = true" in pyvenv_cfg.read_text() def test_env_finds_the_correct_executables(tmp_dir, manager): diff --git a/tox.ini b/tox.ini index 6e40e8b7f8a..a1662f78169 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 3.3.0 isolated_build = True -envlist = py36, py37, py38, py39, doc +envlist = py36, py37, py38, py39 [testenv] whitelist_externals = poetry