0.2.5 • Published 5 years ago

@thejohnfreeman/generator-python v0.2.5

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

generator-python

A Yeoman generator for a Python 3 package with docs, lint, tests, and continuous integration.

npm code style: Prettier

Preview

Take a look at the sample project built with this generator. It is tested on Travis CI and published on PyPI with documentation on Read the Docs.

Install

This generator assumes you are using Poetry for managing Python packages. It will use whatever Python version is activated in your environment. I recommend using pyenv to manage different versions of Python.

# Required
$ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
$ yarn global add yo @thejohnfreeman/generator-python
# Optional
$ curl https://pyenv.run | bash

Use

From within your project directory:

$ pyenv local 3.6-dev
$ yo @thejohnfreeman/python

Options

Although there are some parameters to this generator, such as the package name and author, there are no optional pieces. Instead, I recommend you include every generated file in your first commit, then delete the files you don't want in your second commit, and go from there. That way, if you ever change your mind later, you can resurrect the file that was generated for you, not by re-running the generator and potentially overwriting other files, but by asking Git for the version you deleted:

$ git checkout $(git rev-list -1 HEAD -- "$file")^ -- "$file"
OptionTypeDescription
project_namestringThe project name. The project namespace is distinct from the package namespace. Think GitHub and Read the Docs, where your project coexists with projects from other language ecosystems. Default is the name of the current directory.
package_or_module"package""module"Whether this will be a package (directory) or module (single file).
package_namestringThe package (or module) name, i.e. the name your users will import.This will be the name of your PyPI package, too, but if that name is already taken, you will need to change it in pyproject.toml and README.rst. Default is the project name sanitized to a Python identifier.
versionstringThe first version string. Default is 0.1.0.
authorstringThe author name. Default comes from your Git configuration. This generator assumes a single author. If you need to add more, add them after the generator finishes.
emailstringThe author email. Default comes from your Git configuration.
repositorystringThe repository URL. Default is the project name within your namespace on github.com.
python"3.6dev""3.7dev""3.8dev"The minimum supported version of Python. Default is 3.6-dev.

Why not Cookiecutter?

I explain my reasons on my blog.

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago