Skip to content

Commit

Permalink
Add contributing section in DEVELOPERS
Browse files Browse the repository at this point in the history
Add new makefile command: devenvironment.
  • Loading branch information
HacKanCuBa committed Feb 6, 2018
1 parent 7508571 commit cec9bf3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
12 changes: 10 additions & 2 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

[![Ballmer "developers!"](https://passh.hackan.net/img/developers.png)](http://www.youtube.com/watch?v=V-FkalybggA "Developers")

This guide is intended for developers that want to implement **Passphrase** in their projects.
This guide is intended for developers that want to implement **Passphrase** in their projects or that want to contribute to this project.

## Contributing

If you want to develope or contribute to this project, you can quickly start by issuing `make devenvironment`: it creates a virtualenv directory and installs requirements and the *Passphrase* package. This is, of course, not mandatory.

Every contribution must be acompanied by it's tests. As a general guideline, follow PEP8 (flake8 must run without warnings) and prefer Exceptions over assumptions. Try hard on not to add dependencies: I'm going to reject PRs with external dependencies that are not entirely justified (and for this project in particular, having 0 dependencies is very important).

## About the package

Expand All @@ -27,7 +33,9 @@ my_async_sleep(pause_sec(1, 5))

Of course, you can't just pause the whole server, or let the user hanging there for some seconds... or maybe, you can. I let you decide how to solve it. Another, even better, way to solve this is to provide the system for a secure external random source, such as a randomness generator like Chaoskey.

## Requirements
If you are using a Linux OS, you can use `Aux::system_entropy()` to determine how much entropy does your system have prior making a request for random data (**Passphrase** does this when runs as a script). You should always have more than 128 bits or the call to `os.urandom()` might hang or fail.

### Requirements

* **Python 3.5+**.
* [Flake8](http://flake8.pycqa.org/en/latest/) [optional] for linting.
Expand Down
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TMPDIR := $(shell mktemp -d --tmpdir "passphrase.XXXXXXXXXX")
all:
@echo "Passphrase by HacKan (https://hackan.net)"
@echo "Commands for this makefile:"
@echo -e "\tinstall\n\taltinstall\n\tuninstall\n\taltuninstall\n\tpackage-install\n\tpackage-uninstall\n\tlint\n\ttest\n\tcoverage\n\ttimeit\n\tclean"
@echo -e "\tinstall\n\taltinstall\n\tuninstall\n\taltuninstall\n\tpackage-install\n\tpackage-uninstall\n\tdevenvironment\n\tlint\n\ttest\n\tcoverage\n\ttimeit\n\tclean"

clean:
@rm -vrf \
Expand Down Expand Up @@ -85,4 +85,16 @@ coverage:
timeit:
python3 -m timeit -n 100 -r 10 -s 'import os' 'os.system("python3 -m passphrase -w6 -m")'

.PHONY: install altinstall uninstall altuninstall lint test coverage timeit clean
devenvironment:
@echo "Creating virtualenv"
@[ -d venv ] || virtualenv -p python3 venv
@echo "Installing dev dependencies"
venv/bin/pip install -r requirements-dev.txt
@echo "Installing passphrase"
@venv/bin/python3 setup.py --fullname
@venv/bin/python3 setup.py --description
@venv/bin/python3 setup.py --url
venv/bin/python3 setup.py install
@echo -e '\nAll done. You might want to activate the virtualenv (I can not do it for you): `source venv/bin/activate`'

.PHONY: install altinstall uninstall altuninstall lint test coverage timeit clean devenvironment

0 comments on commit cec9bf3

Please sign in to comment.