A barebones 16 character long password generator.
pip install passplz
$ passplz
=> dc7c5e5260644ce4
Built in Hacker School for the workshop:
passplz
├── bin
│ └── passplz
├── passplz
│ ├── __init__.py
│ └── tests
│ └── __init__.py
├── .gitignore
├── .travis.yml
├── README.md
├── setup.cfg
└── setup.py
- It is a setup script
- Is the centre of all activity in building, distributing, and installing modules using the Distutils
- Used to install a package doing
python setup.py install
pip install .
- Also used to deploy your package to PyPI
Example
from setuptools import setup
setup(name='passplz',
version='0.1.0',
description='A simple password generator',
url='http://github.com/davoclavo/passplz',
author='David Gomez Urquiza',
author_email='[email protected]',
license='MIT',
packages=['passplz'],
test_suite='nose.collector',
tests_require=['nose', 'nose-cov'],
scripts=['bin/passplz'],
)
- pip-only
- List of requirements or dependencies
- Useful for "private applications", such as a webapp that won't be pushed to PyPI
- I use it for development dependencies (such as test dependencies), but would be way cooler to have it all in
setup.py
and `setup.cfg
- Create a PyPI account
- Register your package:
-
python setup.py register -r pypi
- Upload your package:
-
python setup.py sdist upload -r pypi
- Remember to bump versions if a new version is deployed
python setup.py test
- This is a bomb if you are using
nose
because you can load pluginspython setup.py nosetests
- setup.py's sidekick
[nosetests]
with-coverage=1
cover-package=passplz
Continuous Integration using Travis CI
- Signin using Github
- Flick the switch on your project at travis-ci.org/profile
- Add a
.travis.yml
file to your repo - Push changes to github
- PyPI deployment
- Add deploy key to your .yml
- Encrypt your PyPI password:
travis encrypt --add deploy.password
Example:
language: python
sudo: false
python:
- '2.6'
- '2.7'
- '3.3'
- '3.4'
- pypy
deploy:
provider: pypi
user: davoclavo
password:
secure: ib4iaqycgcF3ijSC...
install:
- python setup.py install
- pip install coveralls
script:
- python setup.py nosetests
after_success: coveralls
Coverage using coveralls.io
-
Signup using Github
-
Add to your
.travis.yml
:script: - ... --with-cov install: ... - pip install coveralls after_success: - coveralls
- Add install instructions
Installation
============
From pip
```
pip install passplz
```
From source
```
git clone https://github.com/davoclavo/passplz.git
cd passplz
python setup.py install
```
- Add badges (shields) using shields.io
[![](https://img.shields.io/travis/davoclavo/passplz.svg)](https://travis-ci.org/davoclavo/passplz)
[![](https://img.shields.io/coveralls/davoclavo/passplz.svg)](https://coveralls.io/r/davoclavo/passplz)
[![](https://img.shields.io/pypi/v/passplz.svg)](https://pypi.python.org/pypi/passplz)
[![](https://img.shields.io/badge/coolness-ultrasupercool-blue.svg)](http://i.imgur.com/oJ6ZZf8.gif)