Skip to main content

No project description provided

Project description

git pyinit

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install git-pyinit

License

git-pyinit is distributed under the terms of the MIT license.

How to use

Due to how git works in looking for commands, after you pip install you should have an executable along your path named git-pyinit. This means you can run the following command

git pyinit -h

and see the help. git-pyinit has a few args, and all others are assumed got be for git init. If you do not specify a directory argument, then it will act as if your current directory will be the init argument and will try to create it.

The config and you

The config, which can be opened by your default system editor using git pyinit --edit-config, or opened on your own using your own editor using the path generated from git pyinit --config, has a specific format to follow. Below is a list of sections, and what's applicable in each

  1. Build, python build settings for workflows
    1. python_version = [], a list of python versions that will be added to the yaml file (ie: python_version = ["3.8])
    2. runs-on = "", what to run the workflow yaml on. Defaults to ubuntu-latest
  2. yaml
    1. active = [], what sections to use in order to create yaml files. For instance, active = ["lint", "pytest"] will create two yamls named 'lint.yml' and 'pytest.yml'
  3. <SECTION>
    • A result from the yaml section, these are settings for this specific yaml file generated
    1. active = [], a list of tools that are considered 'active' and each pip installed and added to the yaml file
    2. default = [{}], a list of dictionary mappings of default command mappings that you'd like to change. For instance, if you'd like to add a default flag for every tool, you'd do
    [tool]
    default = [
    {'flags' = ['--check-only']},
    ]
    

Also, for each tool specified in active, you can add additional flags and options using a [section.<TOOLNAME>] section. For example

[tool.isort]
flags = [
'--check-only',
]
file_command = "."

will generate isort . --check-only in your lint.yml. The default find command is $(git ls-files '*.py') for tools

Example

If you are unfamiliar with hatch, you should read up on it here

Running the following command:

git pyinit "test dir"

will create the following directory structure locally

dir-structure

  • A yaml file will look like the one below

yaml-file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_pyinit-1.3.2.tar.gz (57.2 kB view hashes)

Uploaded Source

Built Distribution

git_pyinit-1.3.2-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page