diff --git a/README.rst b/README.rst index 2b05221..75aaff9 100644 --- a/README.rst +++ b/README.rst @@ -266,7 +266,6 @@ macOS). * Clone: ``git clone git@github.com:walles/px.git ; cd px`` * Build and test: ``./tox.sh`` * Run: ``./px.pex`` -* To add dependencies, edit ``requirements.txt`` You can also run ``./devbin/tox-in-docker.sh``, which can be used to run Linux tests on a Mac. diff --git a/devbin/make-executable-zip.sh b/devbin/make-executable-zip.sh index 342a20c..5245ec8 100755 --- a/devbin/make-executable-zip.sh +++ b/devbin/make-executable-zip.sh @@ -21,7 +21,6 @@ python3 -m venv "$ENVDIR" # shellcheck source=/dev/null . "$ENVDIR/bin/activate" -pip install -r "$ROOTDIR/requirements.txt" # Set up file structure in our temporary directory echo 'import px.px; px.px.main()' >"$WORKDIR/__main__.py" @@ -29,10 +28,6 @@ echo 'import px.px; px.px.main()' >"$WORKDIR/__main__.py" # The main attraction! cp -a "$ROOTDIR/px" "$WORKDIR/" -# Dependencies, must match list in requirements.txt -# -# NOTE: This section intentionally left blank - # Tidy up a bit find "$WORKDIR" -name '*.pyc' -delete diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1e6774e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -# These are runtime dependencies, we want them weak to improve -# co-existence with other packages if installed globally using -# pip. - -# NOTE: If you change something here, you must update make-executable-zip.sh as -# well, search for "requirements.txt"! - -# NOTE: This file intentionally left blank because we don't have any third-party -# runtime dependencies. \ No newline at end of file diff --git a/setup.py b/setup.py index fadbf7f..76d7886 100755 --- a/setup.py +++ b/setup.py @@ -2,34 +2,31 @@ import os import re -import subprocess from setuptools import setup -from devbin import update_version_py +from px import version -update_version_py.main() +try: + from devbin import update_version_py -git_version = ( - subprocess.check_output(["git", "describe", "--dirty"]).decode("utf-8").strip() -) - -requirements = None -with open("requirements.txt", encoding="utf-8") as reqsfile: - requirements = reqsfile.readlines() + update_version_py.main() +except ModuleNotFoundError: + print("Devbin not found, assuming source distribution, not updating version.py") with open( os.path.join(os.path.dirname(__file__), "README.rst"), encoding="utf-8" ) as fp: LONG_DESCRIPTION = fp.read() -if not re.match(r"^[0-9]+\.[0-9]+\.[0-9]+$", git_version): +version_for_setuptools = version.VERSION +if not re.match(r"^[0-9]+\.[0-9]+\.[0-9]+$", version_for_setuptools): # Setuptools wants nice version numbers - git_version = "0.0.0" + version_for_setuptools = "0.0.0" setup( name="pxpx", - version=git_version, + version=version_for_setuptools, description="ps and top for Human Beings", long_description=LONG_DESCRIPTION, long_description_content_type="text/x-rst", @@ -50,15 +47,11 @@ "Topic :: Utilities", ], packages=["px"], - install_requires=requirements, # See: http://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag zip_safe=True, setup_requires=[ "pytest-runner", ], - tests_require=[ - "pytest", - ], entry_points={ "console_scripts": [ "px = px.px:main", diff --git a/tox.ini b/tox.ini index 67da2d3..9116624 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ minversion = 3.8.0 mypy_version = 1.11.2 ruff_version = 0.6.5 pytest_version = 8.2.2 -setuptools_version = 68.2.2 +setuptools_version = 74.1.2 envlist= version.py @@ -62,7 +62,6 @@ depends = version.py, ruff-format deps = ruff=={[tox]ruff_version} pytest=={[tox]pytest_version} - -r requirements.txt # Auto-fix locally but not in CI commands = @@ -83,7 +82,6 @@ deps = pytest == {[tox]pytest_version} pytest-avoidance == 0.3.0 python-dateutil >= 2.6.1 - -r requirements.txt commands = pytest --durations=10 --color=yes tests @@ -118,13 +116,12 @@ allowlist_externals = /bin/rm deps = setuptools == {[tox]setuptools_version} - wheel == 0.35.1 + build == 1.2.2 commands = # clean up build/ and dist/ folders /bin/rm -rf build dist # build wheel - /bin/rm -rf dist - python setup.py bdist_wheel --bdist-dir {toxinidir}/bdist --dist-dir {toxinidir}/dist + python -m build --outdir {toxinidir}/dist # Start testing it /bin/bash -c "pip uninstall --yes pxpx" /bin/bash -c "pip install {toxinidir}/dist/pxpx-*.whl"