Skip to content

Commit

Permalink
Merge branch 'main' into pkg_resources-invalid-protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Dec 24, 2023
2 parents f73efcc + 5d93238 commit 3eede00
Show file tree
Hide file tree
Showing 62 changed files with 714 additions and 770 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 69.0.2
current_version = 69.0.3
commit = True
tag = True

Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/ci-sage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out ${{ env.SPKG }}
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: build/pkgs/${{ env.SPKG }}/src
- name: Install prerequisites
Expand All @@ -80,20 +80,14 @@ jobs:

linux:
# https://github.com/sagemath/sage/blob/develop/.github/workflows/docker.yml
# Use branch of ticket https://trac.sagemath.org/ticket/33288
uses: sagemath/sagetrac-mirror/.github/workflows/docker.yml@u/mkoeppe/setuptools_ci_target
uses: sagemath/sage/.github/workflows/docker.yml@develop
with:
# Sage distribution packages to build
targets: setuptools pyzmq
# Standard setting: Test the current beta release of Sage:
sage_repo: sagemath/sage
sage_ref: develop
upstream_artifact: upstream
sage_trac_git: https://github.com/sagemath/sagetrac-mirror.git
# Test with the branch from https://trac.sagemath.org/ticket/33288
# This may provide hotfixes for the CI that have not been merged into
# the sage develop branch yet.
sage_trac_ticket: 33288
# We prefix the image name with the SPKG name ("setuptools-") to avoid the error
# 'Package "sage-docker-..." is already associated with another repository.'
docker_push_repository: ghcr.io/${{ github.repository }}/setuptools-
Expand Down
57 changes: 25 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: tests

on: [push, pull_request, workflow_dispatch]
on:
merge_group:
push:
branches-ignore:
- gh-readonly-queue/** # Temporary merge queue-related GH-made branches
pull_request:
workflow_dispatch:

concurrency:
group: >-
Expand Down Expand Up @@ -43,19 +49,19 @@ jobs:
platform: ubuntu-latest
- python: "3.10"
platform: ubuntu-latest
- python: pypy3.9
- python: pypy3.10
platform: ubuntu-latest
distutils: stdlib
- platform: ubuntu-latest
python: "3.10"
distutils: stdlib
runs-on: ${{ matrix.platform }}
continue-on-error: ${{ matrix.python == '3.12' }}
continue-on-error: ${{ matrix.python == '3.13' }}
env:
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils || 'local' }}
timeout-minutes: 75
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
id: python-install
uses: actions/setup-python@v4
Expand Down Expand Up @@ -85,8 +91,7 @@ jobs:
if: contains(matrix.python, 'pypy')
run: echo "SETUPTOOLS_ENFORCE_DEPRECATION=0" >> $GITHUB_ENV
- name: Install tox
run: |
python -m pip install tox
run: python -m pip install tox
- name: Run
run: tox
- name: Create coverage report
Expand All @@ -103,45 +108,34 @@ jobs:
VM-${{ matrix.platform }},
Py-${{ steps.python-install.outputs.python-version }}
diffcov:
collateral:
strategy:
fail-fast: false
matrix:
job:
- diffcov
- docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install tox
run: |
python -m pip install tox
- name: Evaluate coverage
run: tox
env:
TOXENV: diffcov

docs:
runs-on: ubuntu-latest
env:
TOXENV: docs
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
- name: Install tox
run: |
python -m pip install tox
- name: Run
run: tox
run: python -m pip install tox
- name: Eval ${{ matrix.job }}
run: tox -e ${{ matrix.job }}

check: # This job does nothing and is only used for the branch protection
if: always()

needs:
- integration-test
- test
- docs
- collateral
- test_cygwin

runs-on: ubuntu-latest
Expand Down Expand Up @@ -244,14 +238,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 75
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install tox
run: |
python -m pip install tox
run: python -m pip install tox
- name: Run
run: tox -e release
env:
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.8
hooks:
- id: ruff
- id: ruff-format
13 changes: 11 additions & 2 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v69.0.3
=======

Bugfixes
--------

- Retain valid names with underscores in egg_info.


v69.0.2
=======

Expand Down Expand Up @@ -529,7 +538,7 @@ v65.5.1
Misc
----
* #3638: Drop a test dependency on the ``mock`` package, always use :external+python:py:mod:`unittest.mock` -- by :user:`hroncok`
* #3659: Fixed REDoS vector in package_index.
* #3659: Fixed REDoS vector in package_index -- by :user:`SCH227`


v65.5.0
Expand Down Expand Up @@ -1152,7 +1161,7 @@ Changes
.. warning::
Please note that future releases of setuptools will halt the build process
if a ``pyproject.toml`` file that does not match doc:`the PyPA Specification
<PyPUG:specifications/declaring-project-metadata>` is given.
<PyPUG:specifications/section-distribution-metadata>` is given.
* #3215: Updated ``pyproject.toml`` validation, as generated by ``validate-pyproject==0.6.1``.
* #3218: Prevented builds from erroring if the project specifies metadata via
``pyproject.toml``, but uses other files (e.g. ``setup.py``) to complement it,
Expand Down
6 changes: 1 addition & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@

.. image:: https://img.shields.io/pypi/pyversions/setuptools.svg

.. image:: https://github.com/pypa/setuptools/workflows/tests/badge.svg
.. image:: https://github.com/pypa/setuptools/actions/workflows/main.yml/badge.svg
:target: https://github.com/pypa/setuptools/actions?query=workflow%3A%22tests%22
:alt: tests

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Ruff

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code style: Black

.. image:: https://img.shields.io/readthedocs/setuptools/latest.svg
:target: https://setuptools.pypa.io

Expand Down
24 changes: 11 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,17 @@
# Preserve authored syntax for defaults
autodoc_preserve_defaults = True

intersphinx_mapping.update(
{
'pip': ('https://pip.pypa.io/en/latest', None),
'build': ('https://pypa-build.readthedocs.io/en/latest', None),
'PyPUG': ('https://packaging.python.org/en/latest/', None),
'packaging': ('https://packaging.pypa.io/en/latest/', None),
'twine': ('https://twine.readthedocs.io/en/stable/', None),
'importlib-resources': (
'https://importlib-resources.readthedocs.io/en/latest',
None,
),
}
)
intersphinx_mapping.update({
'pip': ('https://pip.pypa.io/en/latest', None),
'build': ('https://pypa-build.readthedocs.io/en/latest', None),
'PyPUG': ('https://packaging.python.org/en/latest/', None),
'packaging': ('https://packaging.pypa.io/en/latest/', None),
'twine': ('https://twine.readthedocs.io/en/stable/', None),
'importlib-resources': (
'https://importlib-resources.readthedocs.io/en/latest',
None,
),
})

# Add support for linking usernames
github_url = 'https://github.com'
Expand Down
1 change: 1 addition & 0 deletions pkg_resources/_vendor/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude = ["*"]
86 changes: 37 additions & 49 deletions pkg_resources/tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,10 @@ def test_marker_evaluation_with_extras(self):
ws = WorkingSet([])
Foo = Distribution.from_filename(
"/foo_dir/Foo-1.2.dist-info",
metadata=Metadata(
(
"METADATA",
"Provides-Extra: baz\n" "Requires-Dist: quux; extra=='baz'",
)
),
metadata=Metadata((
"METADATA",
"Provides-Extra: baz\n" "Requires-Dist: quux; extra=='baz'",
)),
)
ad.add(Foo)
assert list(ws.resolve(parse_requirements("Foo"), ad)) == [Foo]
Expand All @@ -275,13 +273,11 @@ def test_marker_evaluation_with_extras_normlized(self):
ws = WorkingSet([])
Foo = Distribution.from_filename(
"/foo_dir/Foo-1.2.dist-info",
metadata=Metadata(
(
"METADATA",
"Provides-Extra: baz-lightyear\n"
"Requires-Dist: quux; extra=='baz-lightyear'",
)
),
metadata=Metadata((
"METADATA",
"Provides-Extra: baz-lightyear\n"
"Requires-Dist: quux; extra=='baz-lightyear'",
)),
)
ad.add(Foo)
assert list(ws.resolve(parse_requirements("Foo"), ad)) == [Foo]
Expand All @@ -295,15 +291,13 @@ def test_marker_evaluation_with_multiple_extras(self):
ws = WorkingSet([])
Foo = Distribution.from_filename(
"/foo_dir/Foo-1.2.dist-info",
metadata=Metadata(
(
"METADATA",
"Provides-Extra: baz\n"
"Requires-Dist: quux; extra=='baz'\n"
"Provides-Extra: bar\n"
"Requires-Dist: fred; extra=='bar'\n",
)
),
metadata=Metadata((
"METADATA",
"Provides-Extra: baz\n"
"Requires-Dist: quux; extra=='baz'\n"
"Provides-Extra: bar\n"
"Requires-Dist: fred; extra=='bar'\n",
)),
)
ad.add(Foo)
quux = Distribution.from_filename("/foo_dir/quux-1.0.dist-info")
Expand All @@ -326,15 +320,13 @@ def test_marker_evaluation_with_extras_loop(self):
)
c = Distribution.from_filename(
"/foo_dir/c-1.0.dist-info",
metadata=Metadata(
(
"METADATA",
"Provides-Extra: a\n"
"Requires-Dist: b;extra=='a'\n"
"Provides-Extra: b\n"
"Requires-Dist: foo;extra=='b'",
)
),
metadata=Metadata((
"METADATA",
"Provides-Extra: a\n"
"Requires-Dist: b;extra=='a'\n"
"Provides-Extra: b\n"
"Requires-Dist: foo;extra=='b'",
)),
)
foo = Distribution.from_filename("/foo_dir/foo-0.1.dist-info")
for dist in (a, b, c, foo):
Expand Down Expand Up @@ -572,26 +564,22 @@ def testOptionsAndHashing(self):
assert set(r1.extras) == set(("foo", "bar"))
assert set(r2.extras) == set(("foo", "bar"))
assert hash(r1) == hash(r2)
assert hash(r1) == hash(
(
"twisted",
None,
packaging.specifiers.SpecifierSet(">=1.2"),
frozenset(["foo", "bar"]),
None,
)
)
assert hash(r1) == hash((
"twisted",
None,
packaging.specifiers.SpecifierSet(">=1.2"),
frozenset(["foo", "bar"]),
None,
))
assert hash(
Requirement.parse("Twisted @ https://localhost/twisted.zip")
) == hash(
(
"twisted",
"https://localhost/twisted.zip",
packaging.specifiers.SpecifierSet(),
frozenset(),
None,
)
)
) == hash((
"twisted",
"https://localhost/twisted.zip",
packaging.specifiers.SpecifierSet(),
frozenset(),
None,
))

def testVersionEquality(self):
r1 = Requirement.parse("foo==0.3a2")
Expand Down
Loading

0 comments on commit 3eede00

Please sign in to comment.