Skip to content

Commit 68f7588

Browse files
committed
add noxfile and update readme
1 parent 4368b90 commit 68f7588

File tree

3 files changed

+37
-27
lines changed

3 files changed

+37
-27
lines changed

README.md

+24-25
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
<img src="https://github.com/cs01/pythonloc/raw/master/pythonloc.png"/>
55
</p>
66

7-
<a href="https://pypi.python.org/pypi/pythonloc/">
8-
<img src="https://img.shields.io/badge/pypi-0.1.2.1-blue.svg" /></a>
7+
<a href="https://badge.fury.io/py/pythonloc"><img src="https://badge.fury.io/py/pythonloc.svg" alt="PyPI version" height="18"></a>
98

109
**pythonloc** is a drop in replacement for `python` and `pip` that automatically recognizes a `__pypackages__` directory and prefers importing packages installed in this location over user or global site-packages. If you are familiar with node, `__pypackages__` works similarly to `node_modules`.
1110

@@ -17,6 +16,29 @@ This is a Python implementation of [PEP 582](https://www.python.org/dev/peps/pep
1716

1817
**Please note that PEP 582 has not been accepted. It may or not be accepted in the long term. `pythonloc` is experimental and its API may change in the future.**
1918

19+
## Examples
20+
21+
### Script
22+
23+
24+
```python
25+
# myapp.py
26+
import requests
27+
print(requests)
28+
```
29+
30+
```bash
31+
> piploc install requests
32+
Installing collected packages: urllib3, certifi, chardet, idna, requests
33+
Successfully installed certifi-2018.11.29 chardet-3.0.4 idna-2.8 requests-2.21.0 urllib3-1.24.1
34+
35+
> pipfreezeloc
36+
requests==2.21.0
37+
38+
> pythonloc myapp.py # works!
39+
<module 'requests' from '/tmp/demo/__pypackages__/3.6/lib/requests/__init__.py'>
40+
```
41+
2042
## Testimonials
2143

2244
*Featured on [episode #117](https://pythonbytes.fm/episodes/show/117/is-this-the-end-of-python-virtual-environments) of the Python bytes podcast.*
@@ -166,29 +188,6 @@ pythonloc <app>
166188
In the long term tools will be able to install directly to `__pypackages__` or piploc will be able to read various lockfile formats.
167189

168190

169-
## Examples
170-
171-
### Script
172-
173-
174-
```python
175-
# myapp.py
176-
import requests
177-
print(requests)
178-
```
179-
180-
```bash
181-
> piploc install requests
182-
Installing collected packages: urllib3, certifi, chardet, idna, requests
183-
Successfully installed certifi-2018.11.29 chardet-3.0.4 idna-2.8 requests-2.21.0 urllib3-1.24.1
184-
185-
> pipfreezeloc
186-
requests==2.21.0
187-
188-
> pythonloc myapp.py # works!
189-
<module 'requests' from '/tmp/demo/__pypackages__/3.6/lib/requests/__init__.py'>
190-
```
191-
192191
### CLI
193192

194193
You can run any python command with pythonloc and it will just run python under the hood:

noxfile.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import nox # type: ignore
2+
3+
4+
@nox.session()
5+
def publish(session):
6+
session.run("python", "-m", "pip", "install", "--upgrade", "pip")
7+
session.install("build", "twine")
8+
session.run("rm", "-rf", "dist", "build", external=True)
9+
session.run("python", "-m", "build")
10+
print("REMINDER: Has the changelog been updated?")
11+
session.run("python", "-m", "twine", "upload", "dist/*")

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
setup(
2222
name="pythonloc",
23-
version="0.1.2.1",
23+
version="0.1.2.2",
2424
author="Chad Smith",
25-
author_email="grassfedcode@gmail.com",
25+
author_email="chadsmith.software@gmail.com",
2626
description="Run Python using packages from local directory __pypackages__",
2727
long_description=README,
2828
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)