All Projects → ofek → Hatch

ofek / Hatch

Licence: other
A modern project, package, and virtual env manager for Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Hatch

Backport
A simple CLI tool that automates the process of backporting commits on a GitHub repo
Stars: ✭ 154 (-93.21%)
Mutual labels:  productivity, versioning, cli
Nve
Run any command on specific Node.js versions
Stars: ✭ 531 (-76.59%)
Mutual labels:  versioning, cli, package-manager
Pipenv Pipes
A PipEnv Environment Switcher
Stars: ✭ 122 (-94.62%)
Mutual labels:  cli, virtualenv
Nnn
n³ The unorthodox terminal file manager
Stars: ✭ 13,138 (+479.28%)
Mutual labels:  productivity, cli
Brotab
Control your browser's tabs from the command line
Stars: ✭ 137 (-93.96%)
Mutual labels:  productivity, cli
Dunamai
Dynamic versioning library and CLI
Stars: ✭ 85 (-96.25%)
Mutual labels:  versioning, cli
Cookiecutter Fastapi
Cookiecutter template for FastAPI projects using: Machine Learning, Poetry, Azure Pipelines and Pytests
Stars: ✭ 89 (-96.08%)
Mutual labels:  cli, cookiecutter
Rpmvenv
RPM packager for Python virtualenv.
Stars: ✭ 128 (-94.36%)
Mutual labels:  packaging, virtualenv
Peru
a generic package manager, for including other people's code in your projects
Stars: ✭ 913 (-59.74%)
Mutual labels:  packaging, package-manager
Licenseplist
A license list generator of all your dependencies for iOS applications
Stars: ✭ 1,996 (-11.99%)
Mutual labels:  productivity, cli
Proji
A powerful cross-platform CLI project templating tool.
Stars: ✭ 156 (-93.12%)
Mutual labels:  productivity, cli
Slack Cli
Slack CLI for productive developers
Stars: ✭ 157 (-93.08%)
Mutual labels:  productivity, cli
Tubekit
🧪 kubectl alternative with quick context switching, kubectl on steroids
Stars: ✭ 194 (-91.45%)
Mutual labels:  productivity, cli
Baelte
CLI tool for svelte to help you be productive
Stars: ✭ 85 (-96.25%)
Mutual labels:  productivity, cli
Termy
A terminal with autocomplete
Stars: ✭ 112 (-95.06%)
Mutual labels:  productivity, cli
Node Installed Check
Checks that all dependencies in your package.json have supported versions installed and complies with your specified node engine version range
Stars: ✭ 67 (-97.05%)
Mutual labels:  versioning, cli
Check It Out
A command line interface for Git Checkout. See branches available for checkout.
Stars: ✭ 127 (-94.4%)
Mutual labels:  productivity, cli
Gita
Manage many git repos with sanity 从容管理多个git库
Stars: ✭ 865 (-61.86%)
Mutual labels:  productivity, cli
Fugitive
Simple command line tool to make git more intuitive, along with useful GitHub addons.
Stars: ✭ 20 (-99.12%)
Mutual labels:  productivity, cli
Fades
fades is a system that automatically handles the virtualenvs in the cases normally found when writing scripts and simple programs, and even helps to administer big projects.
Stars: ✭ 182 (-91.98%)
Mutual labels:  packaging, virtualenv

Hatch

Latest PyPI version Travis CI AppVeyor CI Codecov Supported Python versions License

Hatch is a productivity tool designed to make your workflow easier and more efficient, while also reducing the number of other tools you need to know. It aims to make the 90% use cases as pleasant as possible.

For me personally, Hatch has entirely replaced the manual (or entire!) use of these:

           /^\/^\
         _|__|  O|
\/     /~     \_/ \
 \____|__________/  \
        \_______      \
                `\     \                 \
                  |     |                  \
                 /      /                    \
                /     /                       \
              /      /                         \ \
             /     /                            \  \
           /     /             _----_            \   \
          /     /           _-~      ~-_         |   |
         (      (        _-~    _--_    ~-_     _/   |
          \      ~-____-~    _-~    ~-_    ~-_-~    /
            ~-_           _-~          ~-_       _-~
               ~--______-~                ~-___-~

Features

  • Completely cross-platform (terminal colors too!) \(*_^)/
  • Configurable project creation, with good defaults
  • Easiest virtual environment management available, with support for all shells
  • Package management defaults to a per-user basis, allowing global usage with elevated privileges (for your safety)
  • Configurable semantic version bumping
  • Robust build/package cleanup
  • Easy testing with code coverage
  • Simple building and releasing for PyPI
  • All commands are environment-aware w.r.t. python/pip

Usage

Starting a new project is as easy as:

$ hatch new my-app
Created project `my-app`

Now you have a fully functional package that can be built and distributed.

$ tree --dirsfirst my-app
my-app
├── my_app
│   └── __init__.py
├── tests
│   └── __init__.py
├── LICENSE-APACHE
├── LICENSE-MIT
├── MANIFEST.in
├── README.rst
├── requirements.txt
├── setup.py
└── tox.ini

2 directories, 8 files

You can also bump the version of most projects without any setup:

$ git clone -q https://github.com/requests/requests && cd requests
$ hatch grow build
Updated /home/ofek/requests/requests/__version__.py
2.18.4 -> 2.18.4+build.1
$ hatch grow fix
Updated /home/ofek/requests/requests/__version__.py
2.18.4+build.1 -> 2.18.5
$ hatch grow pre
Updated /home/ofek/requests/requests/__version__.py
2.18.5 -> 2.18.5-rc.1
$ hatch grow minor
Updated /home/ofek/requests/requests/__version__.py
2.18.5-rc.1 -> 2.19.0
$ hatch grow major
Updated /home/ofek/requests/requests/__version__.py
2.19.0 -> 3.0.0

Checking code coverage is a breeze:

$ git clone https://github.com/ofek/privy && cd privy
$ hatch test -c
========================= test session starts ==========================
platform linux -- Python 3.5.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: /home/ofek/privy, inifile:
plugins: xdist-1.20.0, mock-1.6.2, httpbin-0.0.7, forked-0.2, cov-2.5.1
collected 10 items

tests/test_privy.py ..........

====================== 10 passed in 4.34 seconds =======================

Tests completed, checking coverage...

Name                  Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------
privy/__init__.py         1      0      0      0   100%
privy/core.py            30      0      0      0   100%
privy/utils.py           13      0      4      0   100%
tests/__init__.py         0      0      0      0   100%
tests/test_privy.py      57      0      0      0   100%
-----------------------------------------------------------------
TOTAL                   101      0      4      0   100%

Creating virtual envs is incredibly simple:

$ hatch env my-app
Already using interpreter /usr/bin/python3
Successfully saved virtual env `my-app` to `/home/ofek/.virtualenvs/my-app`.
$ hatch env -ll
Virtual environments found in /home/ofek/.virtualenvs:

my-app ->
  Version: 3.5.2
  Implementation: CPython

and using them is just as fluid:

$ which python
/usr/bin/python
$ hatch shell my-app
(my-app) $ which python
/home/ofek/.virtualenvs/my-app/bin/python

Keep reading for so much more!

Installation

Hatch is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 3.5+ and PyPy.

$ pip3 install --user hatch

or simply pip if that already points to a Python 3 version.

If hatch doesn't work on your system immediately after that, please run this command then that command.

After the first installation, you may want to run hatch config --restore to ensure your config file is available.

Guide

Contributing

TODO

meta
  • next to the snake ascii art, put a hatched egg (blocks 1.0.0)
project creation
Commands

License

Hatch is distributed under the terms of both

at your option.

Credits

History

Important changes are emphasized.

master

0.23.0

  • Fixed wheel packaging

0.22.0

  • Upgrade userpath dependency
  • Fixed shipped test suite

0.21.0

  • adduserpath dependency has claimed/been renamed userpath
  • Fixed various build errors
  • Don't require internet for tests

0.20.0

  • Conda can now be installed on every platform with a simple hatch conda \[^,^]/
  • new/init commands now enter an interactive mode if no project name is specified!

0.19.0

  • testing now supports the use of a project's dedicated virtual env and any dev requirements can be installed in it automatically!

0.18.0

  • release now allows the use of custom repositories!
  • Fix: cleaning now correctly ignores a project's dedicated virtual env. This behavior can be disabled with the new -nd/--no-detect flag.

0.17.1

0.17.0

  • Hatch now guarantees Windows support via AppVeyor!
  • No project detection will occur if a virtual env is active.

0.16.0

  • Virtual envs created with env, new, init, and shell commands can now access the system site-packages with the -g/--global-packages flag!
  • Improved setup.py generation.

0.15.0

  • use renamed to shell, though it will remain as an alias!
  • new/init commands now only emit a warning when there is no config file.
  • You can now specify what Python to use when creating a virtual env in the new/init command.
  • Fix: use no longer requires the env name argument to be . when targeting a project's dedicated virtual env.

View all history

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].