Skip to content

Commit

Permalink
Fixed installation from sdist (#334)
Browse files Browse the repository at this point in the history
Wheel cannot use pep517 yet because the installation process involves installing wheel because the setuptools build backend declares it as a dependency for building wheels. A future update of pip may solve this problem.

Setuptools_scm, on the other hand, requires wheel as a build time dependency so if somebody tries to install wheel using `--no-binary=:all:`, it also creates a circular dependency.

Fixes #332.
  • Loading branch information
agronholm committed Jan 27, 2020
1 parent ca44496 commit 510a531
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 19 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/codeqa-test-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Upgrade setuptools
run: pip install "setuptools >= 40.9"
- name: Install the project
run: "pip install --no-binary=:all: ."
- name: Install test dependencies
run: pip install .[test]
- name: Test with pytest
run: pytest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
with:
python-version: 3.x
- name: Install dependencies
run: pip install pep517
run: |
pip install "setuptools >= 40.9"
pip install .
- name: Create packages
run: python -m pep517.build --binary --source --out-dir dist/ .
run: python setup.py sdist bdist_wheel
- name: Upload packages
uses: pypa/gh-action-pypi-publish@v1.0.0a0
with:
Expand Down
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
recursive-include src *.py
recursive-include tests *.py *.h *.txt *.c *.dynlib
recursive-include docs *.py *.rst make.bat Makefile
include tests/testdata/test-1.0-py2.py3-none-any.whl
include tox.ini
include manpages/*.rst
prune tests/testdata/*/build
prune tests/testdata/*/dist
prune tests/testdata/*/*.egg-info
15 changes: 10 additions & 5 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ The wheel project welcomes help in the following ways:
Release Process
---------------

To make a new release, edit ``docs/news.rst`` and add a new version and replace
``**UNRELEASED**`` with a release version and date, like
``**X.Y.Z (20XX-YY-ZZ)**``. The github workflow will pick up the new version
and create a new tag, which will then trigger the release workflow which will
package the project and publish the resulting artifacts to PyPI.
To make a new release:

#. Edit ``docs/news.rst`` and replace ``**UNRELEASED**`` with a release version
and date, like ``**X.Y.Z (20XX-YY-ZZ)**``.
#. Replace the ``__version__`` attribute in ``src/wheel/__init__.py`` with the
same version number as above (without the date of course).

The github workflow will pick up the new version from ``news.rst`` and create a
new tag, which will then trigger the release workflow which will package the
project and publish the resulting artifacts to PyPI.
5 changes: 5 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Release Notes
=============

**UNRELEASED**

- Fixed installation of ``wheel`` from sdist which was broken due to a chicken
and egg problem with PEP 517 and setuptools_scm

**0.34.0 (2020-01-27)**

- Dropped Python 3.4 support
Expand Down
7 changes: 0 additions & 7 deletions pyproject.toml

This file was deleted.

3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[metadata]
name = wheel
version = attr: wheel.__version__
description = A built-package format for Python
long_description = file: README.rst
classifiers =
Expand Down Expand Up @@ -32,7 +33,7 @@ package_dir=
= src
packages = find:
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
setup_requires = setuptools_scm >= 3.4
setup_requires = setuptools >= 40.9.0
zip_safe = False

[options.packages.find]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from setuptools import setup

setup(use_scm_version=True)
setup()
2 changes: 1 addition & 1 deletion src/wheel/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from ._version import version as __version__ # noqa: F401
__version__ = '0.34.1'
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
envlist = py27, py35, py36, py37, py38, pypy, pypy3, flake8
minversion = 3.3.0
skip_missing_interpreters = true
isolated_build = true

[testenv]
commands = pytest {posargs}
Expand Down

0 comments on commit 510a531

Please sign in to comment.