Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to flit #350

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.coverage
.coverage*
*.pyc
*.pyo
*.swp
*.swo
env
env-dev
/nodeenv
/nodeenv-env
/TODO
/build/
/dist/
Expand Down
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

52 changes: 25 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: default deploy deploy-github deploy-pypi update-pypi clean tests env
TEST_ENV=env
DEV_TEST_ENV=env-dev
SETUP=python setup.py install > /dev/null
SETUP=pip install -q . > /dev/null

default:
: do nothing when dpkg-buildpackage runs this project Makefile
Expand All @@ -12,20 +12,18 @@ deploy-github:

deploy-pypi:
rm -rf dist
python setup.py sdist bdist_wheel
python -m build
twine upload --repository pypi dist/*

update-pypi:
python setup.py register
twine register

deploy: contributors deploy-github deploy-pypi

clean:
@rm -rf nodeenv.egg-info/
@rm -rf dist/
@rm -rf build/
@rm -rf ${TEST_ENV}/
@rm -rf nodeenv/
@rm -rf nodeenv-env/

clean-test-env:
@rm -rf ${TEST_ENV}
Expand All @@ -37,48 +35,48 @@ 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
env-dev:
@rm -rf ${DEV_TEST_ENV} && \
virtualenv ${DEV_TEST_ENV} && \
. ${DEV_TEST_ENV}/bin/activate && \
@rm -rf ${DEV_TEST_ENV} && \
virtualenv ${DEV_TEST_ENV} && \
. ${DEV_TEST_ENV}/bin/activate && \
pip install -r requirements-dev.txt

test1: clean clean-test-env setup-test-env
@echo " ="
@echo " = test1: separate nodejs's env"
@echo " ="
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
nodeenv -j 4 nodeenv
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
nodeenv -j 4 nodeenv-env
Copy link
Contributor Author

@flying-sheep flying-sheep Dec 20, 2023

Choose a reason for hiding this comment

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

having a directory called nodenv next to a Python file called nodeenv.py confuses things, as both are considered Python packages. This makes sure not tool can be confused


test2: clean clean-test-env setup-test-env
@echo " ="
@echo " = test2: the same virtualenv's env, with 4 jobs"
@echo " ="
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
nodeenv -j 4 -p

test3: clean clean-test-env setup-test-env
@echo " ="
@echo " = test3: the same virtualenv's env, without any params"
@echo " ="
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
nodeenv -p

# https://github.com/ekalinin/nodeenv/issues/43
test4: clean clean-test-env
@echo " ="
@echo " = test4: system nodejs's for python3.9"
@echo " ="
@virtualenv --python=python3.9 ${TEST_ENV} && \
. ${TEST_ENV}/bin/activate && \
${SETUP} && \
@virtualenv --python=python3.9 ${TEST_ENV} && \
. ${TEST_ENV}/bin/activate && \
${SETUP} && \
nodeenv -p --node=system

test5: clean clean-test-env
Expand All @@ -87,7 +85,7 @@ test5: clean clean-test-env
@echo " ="
@virtualenv --python=python2.7 ${TEST_ENV} && \
. ${TEST_ENV}/bin/activate && \
${SETUP} && \
${SETUP} && \
nodeenv -p --prebuilt

test7: clean clean-test-env setup-test-env
Expand All @@ -98,7 +96,7 @@ test7: clean clean-test-env setup-test-env
${SETUP} && \
nodeenv -j 4 -p --prebuilt && \
. ${TEST_ENV}/bin/activate && \
npm install -g sitemap && \
npm install -g sitemap && \
npm -v && \
node -v && \
test "`freeze | grep -v corepack | wc -l`" = " 1";
Expand All @@ -117,18 +115,18 @@ test9: clean clean-test-env setup-test-env
@echo " ="
@echo " = test9: unicode paths, #187"
@echo " ="
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
rm -rf "test dir" && mkdir "test dir" && cd "test dir" && \
nodeenv -j 4 --prebuilt env && \
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
rm -rf "test dir" && mkdir "test dir" && cd "test dir" && \
nodeenv -j 4 --prebuilt env && \
rm -rf "test dir"

test10: clean clean-test-env setup-test-env
@echo " ="
@echo " = test10: symlink does not fail if npm already exists, #189"
@echo " ="
@. ${TEST_ENV}/bin/activate && \
${SETUP} && \
${SETUP} && \
nodeenv -j 4 -p --prebuilt && \
nodeenv -j 4 -p --prebuilt

Expand Down
2 changes: 1 addition & 1 deletion debian-upstream/rules
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ clean:
dh $@ $(DH_VENV_ARGS)

build-arch:
/usr/bin/python setup.py sdist --formats tar
/usr/bin/python -m build --sdist
mkdir -p debian/sdist
tar -x -C debian/sdist --strip-components=1 --exclude '*.egg-info' -f dist/*.tar
dh $@ $(DH_VENV_ARGS) --sourcedir debian/sdist
Expand Down
2 changes: 1 addition & 1 deletion nodeenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

from packaging import version

nodeenv_version = '1.8.0'
nodeenv_version = __version__ = '1.8.0'

join = os.path.join
abspath = os.path.abspath
Expand Down
34 changes: 32 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
requires = ['flit_core >=3.2,<4']
build-backend = 'flit_core.buildapi'

[project]
name = 'nodeenv'
urls.Source = 'https://github.com/ekalinin/nodeenv'
license = { file = 'LICENSE' }
authors = [{ name = 'Eugene Kalinin', email = 'e.v.kalinin@gmail.com' }]
dependencies = ['packaging']
requires-python = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*"
description = 'Node.js virtual environment builder'
readme = 'README.rst'
classifiers = [
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
]
dynamic = ['version']

[project.scripts]
nodeenv = 'nodeenv:main'
68 changes: 0 additions & 68 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 {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