Skip to content

Commit f176f26

Browse files
committed
fix pip installation for Python < 3.6
1 parent 5e90cdf commit f176f26

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
0.1.2.1
2+
3+
Fix installations for Python < 3.6 by adding environment marker to skip pipx (#9)

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ piploc ...
8282
If PEP 582 is adopted, I think `pip` should default to working in the appropriate `__pypackages__` directory. A flag can be added to install to site-packages, if desired.
8383

8484
### pipx
85+
*Note: pipx is included with pythonloc for Python 3.6+ only.*
86+
8587
Installing packages that have so called "entry points" to `__pypackages__` presents a problem. The entry points, or "binaries", are no longer available on your $PATH as they would be if you installed in a virtual environment or to your system. These binaries are massively popular and useful. Examples of binaries are `black`, `pytest`, `tox`, `flake8`, `mypy`, `poetry`, and `pipenv` (and indeed `pythonloc` itself).
8688

8789
`pipx` is a binary installer and runner for Python that, when run, searches for a binary in the appropriate `__pypackages__` location and runs it. If you are familiar with JavaScript's [`npx`](https://www.npmjs.com/package/npx), it's similar to that.
@@ -100,7 +102,7 @@ pipx run --pypackages BINARY [BINARY ARGS]
100102
```
101103
If the binary is not found, and error will be presented.
102104

103-
Something to note here: When installing a new package to an existing `__pypackages__` directory, the entry points will not be created in `.../3.6/lib/bin`, for example, if something is already there. To do that, you need to run `piploc install -U PACKAGE`. When you do that, the entire contents of the directory will be replaced. Fixing this would require a modification to `pip` itself.
105+
**Note**: When installing a new package to an existing `__pypackages__` directory, the entry points will not be created in `.../3.6/lib/bin`, for example, if something is already there. To do that, you need to run `piploc install -U PACKAGE`. When you do that, the entire contents of the directory will be replaced. Fixing this would require a modification to `pip` itself.
104106

105107
If PEP 582 is adopted, `pipx` will be a good companion tool to run binaries.
106108

setup.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,21 @@
1313
import os
1414
from setuptools import find_packages, setup
1515

16-
DEPENDENCIES = ["pipx>=0.12.2.0"]
17-
EXCLUDE_FROM_PACKAGES = ["contrib", "docs", "tests*"]
1816
CURDIR = os.path.abspath(os.path.dirname(__file__))
1917

2018
with io.open(os.path.join(CURDIR, "README.md"), "r", encoding="utf-8") as f:
2119
README = f.read()
2220

2321
setup(
2422
name="pythonloc",
25-
version="0.1.2.0",
23+
version="0.1.2.1",
2624
author="Chad Smith",
2725
author_email="[email protected]",
2826
description="Run Python using packages from local directory __pypackages__",
2927
long_description=README,
3028
long_description_content_type="text/markdown",
3129
url="https://github.com/pipxproject/pythonloc",
32-
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
30+
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
3331
include_package_data=True,
3432
keywords=[],
3533
scripts=[],
@@ -41,7 +39,7 @@
4139
]
4240
},
4341
zip_safe=False,
44-
install_requires=DEPENDENCIES,
42+
install_requires=['pipx>=0.12.2.0;python_version>="3.6"'],
4543
python_requires=">=2.7",
4644
# license and classifier list:
4745
# https://pypi.org/pypi?%3Aaction=list_classifiers
@@ -53,5 +51,6 @@
5351
"Programming Language :: Python :: 2.7",
5452
"Programming Language :: Python :: 3.6",
5553
"Programming Language :: Python :: 3.7",
54+
"Programming Language :: Python :: 3.8",
5655
],
5756
)

0 commit comments

Comments
 (0)