Skip to content

davoclavo/passplz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PASSPLZ

A barebones 16 character long password generator.

Installation

pip install passplz

Usage

$ passplz
=> dc7c5e5260644ce4

Built in Hacker School for the workshop:

Deploy your Python Package 101

Example package

passplz
├── bin
│   └── passplz
├── passplz
│   ├── __init__.py
│   └── tests
│       └── __init__.py
├── .gitignore
├── .travis.yml
├── README.md
├── setup.cfg
└── setup.py

setup.py file

  • 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='d@davo.io',
      license='MIT',
      packages=['passplz'],

      test_suite='nose.collector',
      tests_require=['nose', 'nose-cov'],

      scripts=['bin/passplz'],
      )

requirements.txt file

  • 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

Deploying to PyPI

  1. Create a PyPI account
  2. Register your package: - python setup.py register -r pypi
  3. Upload your package: - python setup.py sdist upload -r pypi
  4. Remember to bump versions if a new version is deployed

Tests

  • python setup.py test
  • This is a bomb if you are using nose because you can load plugins
    • python setup.py nosetests

setup.cfg file

  • 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
    

README.md

  • 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
    ```
[![](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)

https://img.shields.io/travis/joyent/node.svg

Useful references

About

Simple password generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages