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
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source =
omit =
.tox/*
/usr/*
setup.py
# Don't complain if non-runnable code isn't run
*/__main__.py

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Run flake8
run: |
flake8 --extend-ignore=E127 nodeenv.py tests setup.py
flake8 --extend-ignore=E127 nodeenv.py tests

activate-shells:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Nodeenv changelog
=================

Version [unreleased]
--------------------
- The package metadata moved from `setup.py` to `pyproject.toml`, and
`setup.py` is gone: build nodeenv with a PEP 517 frontend such as `pip`
or `python -m build`. Building needs setuptools 77 or later. The license
is declared as the SPDX expression `BSD-3-Clause`
`#374 <https://github.com/ekalinin/nodeenv/issues/374>`_

Version 1.12.0
--------------
- `--print-completion SHELL` prints a completion script for bash, zsh or
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Any of `py310` to `py314` works, depending on the Python versions you have.

```sh
coverage run -p -m pytest -m 'not integration' tests
flake8 --extend-ignore=E127 nodeenv.py tests setup.py
flake8 --extend-ignore=E127 nodeenv.py tests
```

CI runs them on Python 3.10 to 3.14 on Ubuntu, macOS and Windows.
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: default deploy deploy-github deploy-pypi update-pypi clean env site
.PHONY: default deploy deploy-github deploy-pypi clean env site
PYTHON=python3
TEST_ENV=env
DEV_TEST_ENV=env-dev
Expand All @@ -13,13 +13,10 @@ deploy-github:
deploy-pypi:
rm -rf dist
@. ${DEV_TEST_ENV}/bin/activate && \
pip install -U setuptools wheel twine && \
$(PYTHON) setup.py sdist bdist_wheel && \
pip install -U build twine && \
$(PYTHON) -m build && \
twine upload --repository pypi dist/*

update-pypi:
$(PYTHON) setup.py register

deploy: contributors ut deploy-github deploy-pypi

clean:
Expand All @@ -38,7 +35,7 @@ setup-test-env:

env: clean-test-env setup-test-env
@. ${TEST_ENV}/bin/activate && \
$(PYTHON) setup.py install
pip install .

# https://virtualenv.pypa.io/en/legacy/reference.html#cmdoption-no-site-packages
# https://github.com/pypa/virtualenv/issues/1681
Expand Down
4 changes: 2 additions & 2 deletions debian-upstream/rules
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ clean:
dh $@ $(DH_VENV_ARGS)

build-arch:
/usr/bin/python setup.py sdist --formats tar
/usr/bin/python -m build --sdist

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Debian packaging is broken before this PR, at the build-dependency
check: neither python from Build-Depends nor python2.7-minimal from
Pre-Depends exists in Debian 12 or 13, so dpkg-buildpackage stops
before rules runs (dpkg-checkbuilddeps on debian:12-slim and
debian:stable-slim reports python as unmet on master).

Moving only the sdist step to Python 3 would not give a package that
builds: DH_VENV_ARGS still creates the virtualenv with /usr/bin/python,
and the package still pre-depends on Python 2.7. This PR only replaces the
setup.py call, so that rules no longer refers to a removed file.
Moving the Debian packaging to Python 3 is out of scope here.

mkdir -p debian/sdist
tar -x -C debian/sdist --strip-components=1 --exclude '*.egg-info' -f dist/*.tar
tar -x -C debian/sdist --strip-components=1 --exclude '*.egg-info' -f dist/*.tar.gz
dh $@ $(DH_VENV_ARGS) --sourcedir debian/sdist

%:
Expand Down
41 changes: 40 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
requires = ["setuptools>=77", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "nodeenv"
dynamic = ["version", "readme"]
description = "Node.js virtual environment builder"
license = "BSD-3-Clause"
authors = [{ name = "Eugene Kalinin", email = "e.v.kalinin@gmail.com" }]
requires-python = ">=3.10"
dependencies = []
classifiers = [
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules",
]

[project.optional-dependencies]
certifi = ["certifi"]
completion = ["shtab>=1.11"]

[project.urls]
Homepage = "https://github.com/ekalinin/nodeenv"

[project.scripts]
nodeenv = "nodeenv:main"

[tool.setuptools]
py-modules = ["nodeenv"]

[tool.setuptools.dynamic]
version = { attr = "nodeenv.nodeenv_version" }
readme = { file = ["README.rst", "CHANGES"], content-type = "text/x-rst" }
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-e .[completion]

build
coverage
flake8
pytest
Expand Down
64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ setenv =
LANG=en_US.UTF-8
commands =
coverage run -p -m pytest -m 'not integration' {posargs:tests}
flake8 --extend-ignore=E127 nodeenv.py tests setup.py
flake8 --extend-ignore=E127 nodeenv.py tests

[testenv:venv]
envdir = venv-nodeenv
Expand Down
Loading