Skip to content

Commit

Permalink
Merge branch 'main' into feature/compilers-module
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 21, 2024
2 parents 8e48106 + d6652a4 commit a278a41
Show file tree
Hide file tree
Showing 123 changed files with 2,134 additions and 1,292 deletions.
16 changes: 16 additions & 0 deletions .coveragerc
@@ -0,0 +1,16 @@
[run]
omit =
# leading `*/` for pytest-dev/pytest-cov#456
*/.tox/*

# local
*/compat/*
disable_warnings =
couldnt-parse

[report]
show_missing = True
exclude_also =
# jaraco/skeleton#97
@overload
if TYPE_CHECKING:
19 changes: 19 additions & 0 deletions .editorconfig
@@ -0,0 +1,19 @@
root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4
insert_final_newline = true
end_of_line = lf

[*.py]
indent_style = space
max_line_length = 88

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.rst]
indent_style = space
8 changes: 8 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: "all"
128 changes: 104 additions & 24 deletions .github/workflows/main.yml
@@ -1,39 +1,99 @@
name: tests

on: [push, pull_request]
on:
merge_group:
push:
branches-ignore:
# temporary GH branches relating to merge queues (jaraco/skeleton#93)
- gh-readonly-queue/**
tags:
# required if branches-ignore is supplied (jaraco/skeleton#103)
- '**'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
group: >-
${{ github.workflow }}-
${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

permissions:
contents: read

env:
# Environment variable to support color support (jaraco/skeleton#66)
FORCE_COLOR: 1

# Suppress noisy pip warnings
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
PIP_NO_PYTHON_VERSION_WARNING: 'true'
PIP_NO_WARN_SCRIPT_LOCATION: 'true'

# Ensure tests can sense settings about the environment
TOX_OVERRIDE: >-
testenv.pass_env+=GITHUB_*,FORCE_COLOR
jobs:
test:
strategy:
# https://blog.jaraco.com/efficient-use-of-ci-resources/
matrix:
python:
# Build on pre-releases until stable, then stable releases.
# actions/setup-python#213
- ~3.7.0-0
- ~3.10.0-0
- ~3.11.0-0
- "3.8"
- "3.12"
platform:
- ubuntu-latest
- macos-latest
- windows-latest
include:
- python: "3.9"
platform: ubuntu-latest
- python: "3.10"
platform: ubuntu-latest
- python: "3.11"
platform: ubuntu-latest
- python: pypy3.10
platform: ubuntu-latest
runs-on: ${{ matrix.platform }}
continue-on-error: ${{ matrix.python == '3.13' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install tox
run: |
python -m pip install tox
- name: Run tests
run: python -m pip install tox
- name: Run
run: tox

collateral:
strategy:
fail-fast: false
matrix:
job:
- diffcov
- docs
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.python == '3.12' }}
steps:
- 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: Eval ${{ matrix.job }}
run: tox -e ${{ matrix.job }}

test_cygwin:
# disabled due to lack of Rust support pypa/setuptools#3921
if: ${{ false }}
strategy:
matrix:
python:
Expand All @@ -42,9 +102,9 @@ jobs:
- windows-latest
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v1
uses: cygwin/cygwin-install-action@v2
with:
platform: x86_64
packages: >-
Expand All @@ -55,6 +115,7 @@ jobs:
gcc-core,
gcc-g++,
ncompress
git
- name: Run tests
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
run: tox
Expand All @@ -71,16 +132,16 @@ jobs:
env:
SETUPTOOLS_USE_DISTUTILS: local
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: |
python -m pip install tox
- name: Check out pypa/setuptools
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: pypa/setuptools
ref: main
Expand All @@ -97,21 +158,40 @@ jobs:
env:
VIRTUALENV_NO_SETUPTOOLS: null

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

needs:
- test
- collateral
# disabled due to disabled job
# - test_cygwin

runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

release:
needs: test
permissions:
contents: write
needs:
- check
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: 3.11-dev
- name: Install tox
run: |
python -m pip install tox
- name: Release
run: python -m pip install tox
- name: Run
run: tox -e release
env:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.8
hooks:
- id: ruff
- id: ruff-format
16 changes: 16 additions & 0 deletions .readthedocs.yaml
@@ -0,0 +1,16 @@
version: 2
python:
install:
- path: .
extra_requirements:
- docs

# required boilerplate readthedocs/readthedocs.org#10401
build:
os: ubuntu-lts-latest
tools:
python: latest
# post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114
jobs:
post_checkout:
- git fetch --unshallow || true
17 changes: 17 additions & 0 deletions LICENSE
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
Empty file added NEWS.rst
Empty file.
28 changes: 22 additions & 6 deletions README.rst
@@ -1,11 +1,27 @@
Python Module Distribution Utilities extracted from the Python Standard Library
.. image:: https://img.shields.io/pypi/v/distutils.svg
:target: https://pypi.org/project/distutils

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

.. image:: https://github.com/pypa/distutils/actions/workflows/main.yml/badge.svg
:target: https://github.com/pypa/distutils/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

Synchronizing
=============
.. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest
.. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/badge/skeleton-2024-informational
:target: https://blog.jaraco.com/skeleton

Python Module Distribution Utilities extracted from the Python Standard Library

This project is no longer kept in sync with the code still in stdlib, which is deprecated and scheduled for removal.
This package is unsupported except as integrated into and exposed by Setuptools.

To Setuptools
-------------
Integration
-----------

Simply merge the changes directly into setuptools' repo.
17 changes: 11 additions & 6 deletions conftest.py
Expand Up @@ -11,11 +11,9 @@


if platform.system() != 'Windows':
collect_ignore.extend(
[
'distutils/msvc9compiler.py',
]
)
collect_ignore.extend([
'distutils/msvc9compiler.py',
])


@pytest.fixture
Expand Down Expand Up @@ -58,7 +56,7 @@ def _save_cwd():

@pytest.fixture
def distutils_managed_tempdir(request):
from distutils.tests import py38compat as os_helper
from distutils.tests.compat import py38 as os_helper

self = request.instance
self.tempdirs = []
Expand Down Expand Up @@ -152,3 +150,10 @@ def temp_home(tmp_path, monkeypatch):
def fake_home(fs, monkeypatch):
home = fs.create_dir('/fakehome')
return _set_home(monkeypatch, pathlib.Path(home.path))


@pytest.fixture
def disable_macos_customization(monkeypatch):
from distutils import sysconfig

monkeypatch.setattr(sysconfig, '_customize_macos', lambda: None)

0 comments on commit a278a41

Please sign in to comment.