Skip to content

Commit

Permalink
[docs] add maintainers, update contributing instructions (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad Smith committed Nov 4, 2019
1 parent 580f974 commit c6443e9
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 74 deletions.
28 changes: 13 additions & 15 deletions README.md
Expand Up @@ -56,7 +56,7 @@ If you are familiar macOS's `brew`, it's kind of like that but for Python applic

pipx does not ship with pip, but installing it is often an important part of bootstrapping your system.

Python and PyPI allow developers to distribute code with "console script entry points". These scripts let users call into Python code from the command line, effectively acting like standalone applications. `pipx` is a tool to install and run any of these thousands of Python applications available on PyPI in a safe, convenient, and reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all Python packages have entry points, but many do. `pipx` is **not** a tool to install a library and `import` it in your Python code.
Python and PyPI allow developers to distribute code with "console script entry points". These scripts let users call into Python code from the command line, effectively acting like standalone applications. `pipx` is a tool to install and run any of these thousands of Python applications available on PyPI in a safe, convenient, and reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all Python packages have entry points, but many do.

`pipx` enables you to:

Expand Down Expand Up @@ -167,18 +167,23 @@ pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0
pipx is working!
```

### Summary
That's it! Those are the most important commands `pipx` offers. To see all of pipx's documentation, run `pipx --help` or see the [docs](https://pipxproject.github.io/pipx/docs/).

## Testimonials

"*I'm a big fan of pipx. I think pipx is super cool.*"
<div style="text-align: right; margin-right: 10%;">
—<a href="https://twitter.com/mkennedy">Michael Kennedy</a>, co-host of PythonBytes podcast in <a href="https://pythonbytes.fm/episodes/transcript/139/f-yes-for-the-f-strings">episode 139</a>
</div>


"*Thanks for improving the workflow that pipsi has covered in the past. Nicely done!*"
<div style="text-align: right; margin-right: 10%;">
—<a href="https://twitter.com/jezdez">Jannis Leidel</a>, PSF fellow and former pip maintainer
</div>


"*This tool filled in the gap that was missing with pipenv and Virtual Environmentwrapper.*"
<div style="text-align: right; margin-right: 10%;">
—Mason Egger in a <a href="https://medium.com/homeaway-tech-blog/simplify-your-python-developer-environment-aba90f32dddb">blog post</a>
Expand All @@ -187,21 +192,14 @@ pipx is working!

## Credits

pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/zkat/npx).

Creator/Maintainer

- [Chad Smith](https://github.com/cs01/)

Contributors
pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/zkat/npx). It was created by [Chad Smith](https://github.com/cs01/) and has had lots of help from [contributors](https://github.com/pipxproject/pipx/graphs/contributors). The logo was created by [@IrishMorales](https://github.com/IrishMorales).

- [Bjorn Neergaard](https://github.com/neersighted)
pipx is maintained by a team of volunteers (in alphabetical order)
- [Bernát Gábor](https://github.com/gaborbernat)
- [Chad Smith](https://github.com/cs01)
- [Diego Fernandez](https://github.com/aiguofer)
- [Jason R. Coombs](https://github.com/jaraco)
- [joshuarli](https://github.com/joshuarli)
- [Paul Moore](https://github.com/pfmoore)
- [tkossak](https://github.com/tkossak)
- [Tzu-ping Chung](https://github.com/uranusjr)
- [Matthew Clapp](https://github.com/itsayellow)
- [Shawn Hensley](https://github.com/sahensley)

Logo by [@IrishMorales](https://github.com/IrishMorales).
## Contributing
Issues and Pull Requests are definitely welcome! Check out [Contributing](https://pipxproject.github.io/pipx/contributing/) to get started.
117 changes: 92 additions & 25 deletions docs/contributing.md
@@ -1,65 +1,132 @@
pipx uses [nox](https://pypi.org/project/nox/) for development, continuous integration testing, and automation.
Thanks for your interest in contributing to pipx!


## Dependencies
pipx uses an automation tool called [nox](https://pypi.org/project/nox/) for development, continuous integration testing, and various tasks.

`nox` defines tasks or "sessions" in `noxfile.py` which can be run with `nox -s SESSION_NAME`. Session names can be listed with `nox -l`.

Install nox for pipx development:
```
pip install --user git+https://github.com/cs01/nox.git@5ea70723e9e6 nox
```

!!! note
A specific version of nox must be used for pipx development until [nox issue 233](https://github.com/theacodes/nox/issues/233) is resolved.


## Developing pipx
pipx uses pipx to develop -- it's recursive! But don't worry, it's not that scary. You'll be up in running in no time. You'll also need `make` installed. If you don't have `make`, you can look at pipx's `makefile` to see the what the make targets correspond to).
Clone pipx, then enter the root of the pipx repository. Run this command to see which commands you can run with nox.
```
nox -l
```

To develop `pipx`, first clone the repository.
You should see some options that look like this
```
- develop-3.6
- develop-3.7
- develop-3.8
```

Next, run this command which will use the amazing [nox](https://github.com/theacodes/nox) automation framework to set up a virtual environment for each Python version pipx tests against.
Choose the Python version you want to develop in and run the following commands, modifying with your version as necessary.
```
make develop
nox -s develop-3.8
source .nox/develop-3.8/bin/activate
```

A virtual environment with required dependencies is now sandboxed and ready to go in `.nox/develop-3.6` for Python 3.6. Any changes you make to pipx source code will be reflected immediately in the virtual environment inside `.nox/develop-3.6`.
A virtual environment with required dependencies is now sandboxed and activated!

So how do you run with that environment?
Go ahead and make your changes now. You can confirm they still work by running unit tests (see the next section).

You can either enter the virtual environment with `source .nox/develop-3.6/bin/activate` and run `pipx`, or you can run the development `pipx` directly with `.nox/develop-3.6/bin/pipx`. Either way, it's running directly from the source code you just cloned and will reflect any changes you make. In one case the command is a bit longer but your environment isn't modified. In the other, you can type `pipx` but you have to enter the virtual environment. Whichever you prefer will work fine. Go ahead and make your changes now.
To leave the environment, type `deactivate`.

## Testing pipx locally
pipx uses the test automation framework [nox](https://github.com/theacodes/nox). Test definitions live in `noxfile.py`.
Tests are defined as `nox` sessions. You can see all nox sessions with
```
nox -l
```

At the time of this writing, the output looks like this
```
>> nox -l
Sessions defined in /home/csmith/git/pipx/noxfile.py:
* tests-3.6
* tests-3.7
* tests-3.8
- cover -> Coverage analysis
* lint
* docs
- develop-3.6
- develop-3.7
- develop-3.8
- build
- publish
- watch_docs
- publish_docs
```

So to run unit tests in Python3.7, you can run
```
nox -s tests-3.7
```


!!! tip
You can running a specific unit test by passing arguments to pytest, the test runner pipx uses:

```
nox -s tests-3.8 -- -k EXPRESSION
```

Expression can be a test name, such as

Run tests by exiting any virtual environment, then running
```
nox -s tests-3.8 -- -k test_uninstall
```

Coverage errors can usually be ignored when only running a subset of tests.

To run lint checks, run
```
make test
nox -s lint
```
and so on.

## Testing pipx on Continuous Intergration builds
When you push a new git branch, tests will automatically be run against your code as defined in `.travis`.

## Documentation

Documentation has a couple steps to it, both of which are automated. The first step is to generate markdown files from templates. See the `templates` directory. The generated files will have a header at the top indicating they were generated and shouldn't be manually modified. Modify the templates, not the generated markdown files.
`pipx` autogenerates API documentation, and also uses templates.

The second is to compile the markdown files in `docs` with `mkdocs`.
When updating pipx docs, make sure you are either modifying a file in the `templates` directory, or the `docs` directory. If in the `docs` directory, make sure the file was not autogenerated from the `templates` directory.

Both of these steps are done in a single build command:
You can generate the documentation with
```
make docs
nox -s docs
```

To preview changes, including live reloading, open another terminal and run
```
make watch_docs
```
This will capture CLI documentation for any pipx argument modifications, as well as generate templates to the docs directory.

If you make changes to the pipx cli api or any template, regenerate the `.md` files in the `docs` folder:
To preview changes, including live reloading, open another terminal and run
```
make docs
nox -s watch_docs
```

### Publishing Doc Changes to GitHub pages
```
make publish_docs
nox -s publish_docs
```

## Release New `pipx` Version
To create a new release

* make sure the changelog is updated
* update the version of pipx defined in `setup.py`

Finally, run
```bash
nox -s publish
nox -s publish_docs
```
make publish
```
and don't forget to publish updated documenation.
28 changes: 13 additions & 15 deletions docs/index.md
Expand Up @@ -56,7 +56,7 @@ If you are familiar macOS's `brew`, it's kind of like that but for Python applic

pipx does not ship with pip, but installing it is often an important part of bootstrapping your system.

Python and PyPI allow developers to distribute code with "console script entry points". These scripts let users call into Python code from the command line, effectively acting like standalone applications. `pipx` is a tool to install and run any of these thousands of Python applications available on PyPI in a safe, convenient, and reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all Python packages have entry points, but many do. `pipx` is **not** a tool to install a library and `import` it in your Python code.
Python and PyPI allow developers to distribute code with "console script entry points". These scripts let users call into Python code from the command line, effectively acting like standalone applications. `pipx` is a tool to install and run any of these thousands of Python applications available on PyPI in a safe, convenient, and reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all Python packages have entry points, but many do.

`pipx` enables you to:

Expand Down Expand Up @@ -167,18 +167,23 @@ pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0
pipx is working!
```

### Summary
That's it! Those are the most important commands `pipx` offers. To see all of pipx's documentation, run `pipx --help` or see the [docs](https://pipxproject.github.io/pipx/docs/).

## Testimonials

"*I'm a big fan of pipx. I think pipx is super cool.*"
<div style="text-align: right; margin-right: 10%;">
—<a href="https://twitter.com/mkennedy">Michael Kennedy</a>, co-host of PythonBytes podcast in <a href="https://pythonbytes.fm/episodes/transcript/139/f-yes-for-the-f-strings">episode 139</a>
</div>


"*Thanks for improving the workflow that pipsi has covered in the past. Nicely done!*"
<div style="text-align: right; margin-right: 10%;">
—<a href="https://twitter.com/jezdez">Jannis Leidel</a>, PSF fellow and former pip maintainer
</div>


"*This tool filled in the gap that was missing with pipenv and Virtual Environmentwrapper.*"
<div style="text-align: right; margin-right: 10%;">
—Mason Egger in a <a href="https://medium.com/homeaway-tech-blog/simplify-your-python-developer-environment-aba90f32dddb">blog post</a>
Expand All @@ -187,21 +192,14 @@ pipx is working!

## Credits

pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/zkat/npx).

Creator/Maintainer

- [Chad Smith](https://github.com/cs01/)

Contributors
pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/zkat/npx). It was created by [Chad Smith](https://github.com/cs01/) and has had lots of help from [contributors](https://github.com/pipxproject/pipx/graphs/contributors). The logo was created by [@IrishMorales](https://github.com/IrishMorales).

- [Bjorn Neergaard](https://github.com/neersighted)
pipx is maintained by a team of volunteers (in alphabetical order)
- [Bernát Gábor](https://github.com/gaborbernat)
- [Chad Smith](https://github.com/cs01)
- [Diego Fernandez](https://github.com/aiguofer)
- [Jason R. Coombs](https://github.com/jaraco)
- [joshuarli](https://github.com/joshuarli)
- [Paul Moore](https://github.com/pfmoore)
- [tkossak](https://github.com/tkossak)
- [Tzu-ping Chung](https://github.com/uranusjr)
- [Matthew Clapp](https://github.com/itsayellow)
- [Shawn Hensley](https://github.com/sahensley)

Logo by [@IrishMorales](https://github.com/IrishMorales).
## Contributing
Issues and Pull Requests are definitely welcome! Check out [Contributing](https://pipxproject.github.io/pipx/contributing/) to get started.
8 changes: 4 additions & 4 deletions noxfile.py
Expand Up @@ -75,7 +75,7 @@ def develop(session):
session.install("-e", ".")


@nox.session(python=["3.7"])
@nox.session(python="3.7")
def build(session):
session.install("setuptools")
session.install("wheel")
Expand All @@ -84,20 +84,20 @@ def build(session):
session.run("python", "setup.py", "--quiet", "sdist", "bdist_wheel")


@nox.session(python=["3.7"])
@nox.session(python="3.7")
def publish(session):
build(session)
print("REMINDER: Has the changelog been updated?")
session.run("python", "-m", "twine", "upload", "dist/*")


@nox.session(python=["3.7"])
@nox.session(python="3.7")
def watch_docs(session):
session.install(*doc_dependencies)
session.run("mkdocs", "serve")


@nox.session(python=["3.7"])
@nox.session(python="3.7")
def publish_docs(session):
session.install(*doc_dependencies)
session.run("python", "generate_docs.py")
Expand Down
28 changes: 13 additions & 15 deletions templates/index.md
Expand Up @@ -51,7 +51,7 @@ If you are familiar macOS's `brew`, it's kind of like that but for Python applic

pipx does not ship with pip, but installing it is often an important part of bootstrapping your system.

Python and PyPI allow developers to distribute code with "console script entry points". These scripts let users call into Python code from the command line, effectively acting like standalone applications. `pipx` is a tool to install and run any of these thousands of Python applications available on PyPI in a safe, convenient, and reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all Python packages have entry points, but many do. `pipx` is **not** a tool to install a library and `import` it in your Python code.
Python and PyPI allow developers to distribute code with "console script entry points". These scripts let users call into Python code from the command line, effectively acting like standalone applications. `pipx` is a tool to install and run any of these thousands of Python applications available on PyPI in a safe, convenient, and reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all Python packages have entry points, but many do.

`pipx` enables you to:

Expand Down Expand Up @@ -162,18 +162,23 @@ pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0
pipx is working!
```

### Summary
That's it! Those are the most important commands `pipx` offers. To see all of pipx's documentation, run `pipx --help` or see the [docs](https://pipxproject.github.io/pipx/docs/).

## Testimonials

"*I'm a big fan of pipx. I think pipx is super cool.*"
<div style="text-align: right; margin-right: 10%;">
—<a href="https://twitter.com/mkennedy">Michael Kennedy</a>, co-host of PythonBytes podcast in <a href="https://pythonbytes.fm/episodes/transcript/139/f-yes-for-the-f-strings">episode 139</a>
</div>


"*Thanks for improving the workflow that pipsi has covered in the past. Nicely done!*"
<div style="text-align: right; margin-right: 10%;">
—<a href="https://twitter.com/jezdez">Jannis Leidel</a>, PSF fellow and former pip maintainer
</div>


"*This tool filled in the gap that was missing with pipenv and Virtual Environmentwrapper.*"
<div style="text-align: right; margin-right: 10%;">
—Mason Egger in a <a href="https://medium.com/homeaway-tech-blog/simplify-your-python-developer-environment-aba90f32dddb">blog post</a>
Expand All @@ -182,21 +187,14 @@ pipx is working!

## Credits

pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/zkat/npx).

Creator/Maintainer

- [Chad Smith](https://github.com/cs01/)

Contributors
pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/zkat/npx). It was created by [Chad Smith](https://github.com/cs01/) and has had lots of help from [contributors](https://github.com/pipxproject/pipx/graphs/contributors). The logo was created by [@IrishMorales](https://github.com/IrishMorales).

- [Bjorn Neergaard](https://github.com/neersighted)
pipx is maintained by a team of volunteers (in alphabetical order)
- [Bernát Gábor](https://github.com/gaborbernat)
- [Chad Smith](https://github.com/cs01)
- [Diego Fernandez](https://github.com/aiguofer)
- [Jason R. Coombs](https://github.com/jaraco)
- [joshuarli](https://github.com/joshuarli)
- [Paul Moore](https://github.com/pfmoore)
- [tkossak](https://github.com/tkossak)
- [Tzu-ping Chung](https://github.com/uranusjr)
- [Matthew Clapp](https://github.com/itsayellow)
- [Shawn Hensley](https://github.com/sahensley)

Logo by [@IrishMorales](https://github.com/IrishMorales).
## Contributing
Issues and Pull Requests are definitely welcome! Check out [Contributing](https://pipxproject.github.io/pipx/contributing/) to get started.

0 comments on commit c6443e9

Please sign in to comment.