Quickly initiate a python project from scratch.
Project description
Welcome to pygitrepo Documentation
pygitrepo can quickly initiate a python project from scratch, with these powerful tools out-of-the-box:
make up: single command to create/clean virtual environment.
make reformat: command to Google stylize your code.
make install: (For end user) install your package (setup.py file is out-of-the-box).
make dev_install: (For package developer) install your package in dev mode (setup.py file is out-of-the-box).
make test: unittest with pytest (tests folder and scripts is out-of-the-box, just follow the pattern and create more).
make cov: code coverage test with coverage, the default .coveragerc fit most of the case).
make tox: multi python version test with tox, the default tox.ini fit most of the case.
built-in integration with https://travis-ci.org/.
built-in integration with https://codecov.io/.
make build_doc / view_doc: easy sphinx document writing, no need to run sphinx-quickstart, and write conf.py file.
make deploy_doc: deploy document to AWS S3.
make publish: publish your project to PyPI
pygitrepo is compatible with Windows / MacOS / Linux.
Quick Links
Usage
Install: pip install pygitrepo.
Run command line tool: pygitrepo-init.
A <repo-name> directory will be created, you can use this as your github repo directory.
Take a look at Makefile, all magic happens here!
If you want to programmatically initialize your repository, you can do:
import pygitrepo
package_name = "pygitrepo"
github_username = "xxx"
supported_py_ver = ["2.7.13", "3.4.6", "3.5.3", "3.6.2"]
author_name = "xxx"
author_email = "example@email.com"
license="MIT"
s3_bucket = "doc-host"
if __name__ == "__main__":
pygitrepo.init(
package_name=package_name,
github_username=github_username,
supported_py_ver=supported_py_ver,
author_name=author_name,
author_email=author_email,
license=license,
s3_bucket=s3_bucket,
)
Things Need to Install
For Windows (Git-Bash and MinGW)
Because Windows doesn’t have shell script and make command, so we have to install some third-party software to make it works.
Install Git Bash as shell emulator
Now you can use C:\Program Files\Git\git-bash.exe like the terminal in MacOS/Linux.
Install MinGW
Download and install, use the installer to install MinGW Base.
Find C:\MinGW\bin\mingw32-make.exe, copy and paste and rename as C:\MinGW\bin\make.exe.
Add C:\MinGW\bin to $PATH (environment variable).
Now you can use make <target> in git-bash.exe now.
For MacOS (HomeBrew)
You have to make sure:
HomeBrew is installed.
There’s two way of using virtualenv in MacOS:
Use generic virtualenv.
Use pyenv + pyenv-virtualenv.
I prefer pyenv + pyenv-virtualenv, because it allows you:
use tox to test against multiple python version locally before using cloud CI (continues integration).
will not mess up your global python environment.
the Makefile will do the pyenv + pyenv-virtualenv setup for you, just make sure that you have HomeBrew installed.
AWS Command Line (Optional)
Use AWS S3 to host your doc site is a good idea!
We need awscli to automate the deployment.
Install awscli, just pip install awscli.
Configure your API token, just aws configure and follow the instruction.
Config PyPI (Optional)
If you want to publish your package to PyPI or new PyPI, you need a pypi account and Configure your credential.
Create a ${HOME}/.pypirc file.
put these contents:
[distutils] index-servers = pypi [pypi] username:<username> password:<password>
CI (Continues Integration) (Optional)
- Test with travis-ci, basically you just need to:
sign in using GitHub account.
toggle on your repo.
Install
pygitrepo is released on PyPI, so all you need is:
$ pip install pygitrepo
To upgrade to latest version:
$ pip install --upgrade pygitrepo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pygitrepo-0.0.9-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cd4e16fd946e49b64af1e43db5bb47b7992f59a36a9231770cad9aa4ced1afd |
|
MD5 | 38ca0b7399001a9d411dba9d30941531 |
|
BLAKE2b-256 | 6518ab648bfc829e9eba4f46cf2dd05f2182f8a1d6c90c3458191cb62ebdf6a4 |