Skip to content

Commit

Permalink
Merge branch 'main' into maintenance/flake8-exclude-.tox
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 16, 2021
2 parents b091db9 + bf19569 commit 04a916e
Show file tree
Hide file tree
Showing 32 changed files with 561 additions and 360 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 = 51.1.0
current_version = 51.2.0
commit = True
tag = True

Expand Down
11 changes: 6 additions & 5 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[flake8]
max-line-length = 88

# jaraco/skeleton#34
max-complexity = 10

extend-exclude =
build
setuptools/_vendor
setuptools/_distutils
pkg_resources/_vendor
ignore =
# W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513
W503
# W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545
W504

extend-ignore =
# Black creates whitespace before colon
E203
setuptools/site-patch.py F821
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: automerge
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: automerge
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Automated Tests
name: tests

on: [push, pull_request]

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: stable
rev: 20.8b1
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
rev: v1.9.1
hooks:
- id: blacken-docs
37 changes: 37 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
v51.2.0
-------


Changes
^^^^^^^
* #2493: Use importlib.import_module() rather than the deprectated loader.load_module()
in pkg_resources namespace delaration -- by :user:`encukou`

Documentation changes
^^^^^^^^^^^^^^^^^^^^^
* #2525: Fix typo in the document page about entry point. -- by :user:`jtr109`

Misc
^^^^
* #2534: Avoid hitting network during test_easy_install.


v51.1.2
-------


Misc
^^^^
* #2505: Disable inclusion of package data as it causes 'tests' to be included as data.


v51.1.1
-------


Misc
^^^^
* #2534: Avoid hitting network during test_virtualenv.test_test_command.


v51.1.0
-------

Expand Down Expand Up @@ -371,6 +407,7 @@ v47.2.0
Changes
^^^^^^^
* #2194: Editable-installed entry points now load significantly faster on Python versions 3.8+.
* #1471: Incidentally fixed by #2194 on Python 3.8 or when importlib_metadata is present.


v47.1.1
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

.. _PyPI link: https://pypi.org/project/setuptools

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

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
Expand Down
2 changes: 2 additions & 0 deletions changelog.d/2481.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Define ``create_module()`` and ``exec_module()`` methods in ``VendorImporter``
to get rid of ``ImportWarning`` -- by :user:`hroncok`
1 change: 1 addition & 0 deletions changelog.d/2529.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue where version tags may be added multiple times
2 changes: 1 addition & 1 deletion docs/setuptools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ To use this feature:
]
build-backend = "setuptools.build_meta"
* Use a :pep:`517` compatible build frontend, such as ``pip >= 19`` or ``pep517``.
* Use a :pep:`517` compatible build frontend, such as ``pip >= 19`` or ``build``.

.. warning::

Expand Down
12 changes: 8 additions & 4 deletions docs/userguide/dependency_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ When your project is installed (e.g. using pip), all of the dependencies not
already installed will be located (via PyPI), downloaded, built (if necessary),
and installed and 2) Any scripts in your project will be installed with wrappers
that verify the availability of the specified dependencies at runtime.


Platform specific dependencies
------------------------------
Expand Down Expand Up @@ -202,7 +202,7 @@ Optional dependencies
Setuptools allows you to declare dependencies that only get installed under
specific circumstances. These dependencies are specified with ``extras_require``
keyword and are only installed if another package depends on it (either
directly or indirectly) This makes it convenient to declare dependencies for
directly or indirectly) This makes it convenient to declare dependencies for
ancillary functions such as "tests" and "docs".

.. note::
Expand Down Expand Up @@ -262,8 +262,12 @@ First is the console_scripts entry point:
}
)
When the script ``rst2pdf`` is run, it will trigger the installation of
the two dependencies ``PDF`` maps to.
This syntax indicates that the entry point (in this case a console script)
is only valid when the PDF extra is installed. It is up to the installer
to determine how to handle the situation where PDF was not indicated
(e.g. omit the console script, provide a warning when attempting to load
the entry point, assume the extras are present and let the implementation
fail later).

The second use case is that other package can use this "extra" for their
own dependencies. For example, if "Project-B" needs "project A" with PDF support
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/entry_point.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ with ``__init__.py`` as:

.. code-block:: python
def helloworld():
def hello_world():
print("Hello world")
and ``__main__.py`` providing a hook:
Expand Down
12 changes: 8 additions & 4 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import inspect
import ntpath
import posixpath
import importlib
from pkgutil import get_importer

try:
Expand Down Expand Up @@ -696,7 +697,8 @@ def add(self, dist, entry=None, insert=True, replace=False):
keys2.append(dist.key)
self._added_new(dist)

def resolve(self, requirements, env=None, installer=None,
# FIXME: 'WorkingSet.resolve' is too complex (11)
def resolve(self, requirements, env=None, installer=None, # noqa: C901
replace_conflicting=False, extras=None):
"""List all distributions needed to (recursively) meet `requirements`
Expand Down Expand Up @@ -1745,7 +1747,8 @@ def _get_date_and_size(zip_stat):
timestamp = time.mktime(date_time)
return timestamp, size

def _extract_resource(self, manager, zip_path):
# FIXME: 'ZipProvider._extract_resource' is too complex (12)
def _extract_resource(self, manager, zip_path): # noqa: C901

if zip_path in self._index():
for name in self._index()[zip_path]:
Expand Down Expand Up @@ -2209,7 +2212,7 @@ def _handle_ns(packageName, path_item):
if subpath is not None:
path = module.__path__
path.append(subpath)
loader.load_module(packageName)
importlib.import_module(packageName)
_rebuild_mod_path(path, packageName, module)
return subpath

Expand Down Expand Up @@ -2858,7 +2861,8 @@ def get_entry_info(self, group, name):
"""Return the EntryPoint object for `group`+`name`, or ``None``"""
return self.get_entry_map(group).get(name)

def insert_on(self, path, loc=None, replace=False):
# FIXME: 'Distribution.insert_on' is too complex (13)
def insert_on(self, path, loc=None, replace=False): # noqa: C901
"""Ensure self.location is on path
If replace=False (default):
Expand Down
6 changes: 6 additions & 0 deletions pkg_resources/extern/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def load_module(self, fullname):
"distribution.".format(**locals())
)

def create_module(self, spec):
return self.load_module(spec.name)

def exec_module(self, module):
pass

def install(self):
"""
Install this importer into sys.meta_path if not already present.
Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ skip-string-normalization = true

[tool.setuptools_scm]

# jaraco/skeleton#22
[tool.jaraco.pytest.plugins.black]
[pytest.enabler.black]
#addopts = "--black"

# jaraco/skeleton#22
[tool.jaraco.pytest.plugins.mypy]
[pytest.enabler.mypy]
#addopts = "--mypy"

[tool.jaraco.pytest.plugins.flake8]
[pytest.enabler.flake8]
addopts = "--flake8"

[tool.jaraco.pytest.plugins.cov]
[pytest.enabler.cov]
addopts = "--cov"

[tool.towncrier]
Expand Down
22 changes: 14 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[metadata]
license_file = LICENSE
license_files =
LICENSE
name = setuptools
version = 51.1.0
version = 51.2.0
author = Python Packaging Authority
author_email = [email protected]
description = Easily download, build, install, upgrade, and uninstall Python packages
Expand All @@ -22,14 +23,20 @@ project_urls =
Documentation = https://setuptools.readthedocs.io/

[options]
packages = find:
packages = find_namespace:
py_modules = easy_install
include_package_data = true
# disabled as it causes tests to be included #2505
# include_package_data = true
python_requires = >=3.6
install_requires =

[options.packages.find]
exclude = *.tests
exclude =
build*
docs*
tests*
*.tests
tools*

[options.extras_require]
testing =
Expand All @@ -40,8 +47,7 @@ testing =
pytest-black >= 0.3.7; python_implementation != "PyPy"
pytest-cov
pytest-mypy; python_implementation != "PyPy"
# jaraco/skeleton#22
jaraco.test >= 3.2.0
pytest-enabler

# local
mock
Expand All @@ -57,7 +63,7 @@ docs =
# Keep these in sync with docs/requirements.txt
# upstream
sphinx
jaraco.packaging >= 6.1
jaraco.packaging >= 8.2
rst.linker >= 1.9

# local
Expand Down
Loading

0 comments on commit 04a916e

Please sign in to comment.