Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@ on: [push, pull_request]

jobs:
Tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python-version: [3.8]
os: [Ubuntu, MacOS, Windows]
python-version: [3.6, 3.7, 3.8, 3.9]
experimental: [false]
include:
- os: Ubuntu
python-version: "3.10.0-alpha - 3.10.0"
experimental: true
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ jobs:
Tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
exclude:
- os: MacOS
python-version: pypy3
- os: Windows
python-version: [3.6, 3.7, 3.8, 3.9]
experimental: [false]
include:
- os: Ubuntu
python-version: pypy3
experimental: false
- os: Ubuntu
python-version: "3.10.0-alpha - 3.10.0"
experimental: true
steps:
- uses: actions/checkout@v2

Expand All @@ -33,10 +37,7 @@ jobs:

- name: Install poetry
shell: bash
run: |
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
python get-poetry.py --preview -y
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
run: pip install poetry

- name: Configure poetry
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
)

- repo: https://github.com/timothycrosley/isort
rev: 5.7.0
rev: 5.8.0
hooks:
- id: isort
additional_dependencies: [toml]
Expand Down
190 changes: 88 additions & 102 deletions poetry.lock

Large diffs are not rendered by default.

36 changes: 29 additions & 7 deletions poetry/core/packages/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Package(PackageSpecification):
"3.7",
"3.8",
"3.9",
"3.10",
}

def __init__(
Expand Down Expand Up @@ -270,24 +271,45 @@ def all_classifiers(self) -> List[str]:
else:
python_constraint = self.python_constraint

for version in sorted(self.AVAILABLE_PYTHONS):
python_classifier_prefix = "Programming Language :: Python"
python_classifiers = []

# we sort python versions by sorting an int tuple of (major, minor) version
# to ensure we sort 3.10 after 3.9
for version in sorted(
self.AVAILABLE_PYTHONS, key=lambda x: tuple(map(int, x.split(".")))
):
if len(version) == 1:
constraint = parse_constraint(version + ".*")
else:
constraint = Version.parse(version)

if python_constraint.allows_any(constraint):
classifiers.append(
"Programming Language :: Python :: {}".format(version)
)
classifier = "{} :: {}".format(python_classifier_prefix, version)
if classifier not in python_classifiers:
python_classifiers.append(classifier)

# Automatically set license classifiers
if self.license:
classifiers.append(self.license.classifier)

classifiers = set(classifiers)

return sorted(classifiers)
# Sort classifiers and insert python classifiers at the right location. We do
# it like this so that 3.10 is sorted after 3.9.
sorted_classifiers = []
python_classifiers_inserted = False
for classifier in sorted(set(classifiers)):
if (
not python_classifiers_inserted
and classifier > python_classifier_prefix
):
sorted_classifiers.extend(python_classifiers)
python_classifiers_inserted = True
sorted_classifiers.append(classifier)

if not python_classifiers_inserted:
sorted_classifiers.extend(python_classifiers)

return sorted_classifiers

@property
def urls(self) -> Dict[str, str]:
Expand Down
1 change: 1 addition & 0 deletions poetry/core/version/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"3.7.*",
"3.8.*",
"3.9.*",
"3.10.*",
]


Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ dataclasses = {version = "^0.8", python = "~3.6"}
[tool.poetry.dev-dependencies]
pre-commit = {version = "^2.10.0", python = "^3.6.1"}
pyrsistent = "^0.16.0"
pytest = "^4.6"
pytest = "^6.2"
pytest-cov = "^2.8"
pytest-mock = "^2.0"
pytest-mock = "^3.5"
tox = "^3.0"
vendoring = {version = "^0.3", python = "^3.8"}
pep517 = "^0.8.2"
black = {version = "^20.8b1", markers = "python_version >= '3.6' and python_version < '4.0' and implementation_name != 'pypy'"}
isort = "^5.7.0"
isort = "^5.8.0"

[tool.black]
line-length = 88
Expand Down
1 change: 1 addition & 0 deletions tests/masonry/builders/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def test_get_metadata_content():
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries :: Python Modules",
]
Expand Down
2 changes: 2 additions & 0 deletions tests/masonry/builders/test_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def test_complete():
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: time
Expand Down Expand Up @@ -375,6 +376,7 @@ def test_complete_no_vcs():
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: time
Expand Down
1 change: 1 addition & 0 deletions tests/masonry/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def test_prepare_metadata_for_build_wheel():
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: time
Expand Down
1 change: 1 addition & 0 deletions tests/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def test_create_poetry():
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries :: Python Modules",
]
Expand Down
4 changes: 3 additions & 1 deletion tests/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Optional

from poetry.core.toml import TOMLFile
from poetry.core.utils._compat import PY37


try:
Expand Down Expand Up @@ -60,8 +61,9 @@ def subprocess_run(*args, **kwargs): # type: (str, Any) -> subprocess.Completed
"""
Helper method to run a subprocess. Asserts for success.
"""
compat_kwargs = {"text" if PY37 else "universal_newlines": True}
result = subprocess.run(
args, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs
args, **compat_kwargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs
)
assert result.returncode == 0
return result
Expand Down