Skip to main content

Devloper shell for easy startup...

Project description

A "dev-shell" for Python projects ;)

pytest codecov

This small project is intended to improve the start-up for collaborators.

The idea is to make the project setup as simple as possible. Just clone the sources and start a script and you're done ;)

Run Tests? Just start the script and call the "run test command".

The "dev-shell" is the base to create a CLI and a shell. It also

It also shows how to make a project bootstrap as simply as possible, e.g.:

~$ git clone https://github.com/jedie/dev-shell.git
~$ cd dev-shell
~/dev-shell$ ./devshell.py pytest

How it works

First start of the Python script ./devshell.py will bootstrap:

  • Generate a Python virtual environment (in short: venv)
  • Install poetry
  • Install project dependencies and the project himself

The output on first bootstrap start looks like:

~/dev-shell$ ./devshell.py
Create venv here: ~/dev-shell/.venv
Collecting pip
...
Successfully installed pip-21.0.1
Collecting poetry
...
Installing dependencies from lock file

Package operations: 31 installs, 1 update, 0 removals

...

Installing the current project: dev-shell (0.0.1alpha0)


+ .venv/bin/python .venv/bin/devshell


Developer shell - dev_shell - v0.2.0rc1


Documented commands (use 'help -v' for verbose/'help <topic>' for details):

dev-shell commands
==================
fix_code_style  linting  list_venv_packages  publish  pytest  update

...

(dev_shell) quit
~/dev-shell$

The first bootstrap start takes a few seconds. Each later startup detects the existing virtualenv and is very fast:

~/dev-shell$ ./devshell.py

Developer shell - dev_shell - v0.2.0rc1

(dev_shell) help

Info: The .venv will be automatically updated via poetry install call if the poetry.lock file has been changed.

A call with --update will force to call some create/update steps, e.g.:

~/dev-shell$ ./devshell.py --update

You can also just delete /.venv/ and start devshell.py again ;)

(Using --update is not to be confused with the call of "update" command.)

compatibility

dev-shell version OS Python version
>=v0.0.1 Linux + MacOS + Windows 3.9, 3.8, 3.7

See also github test configuration: .github/workflows/test.yml

History

  • dev
    • TBC
  • v0.2.0 - 2021-04-11
    • Rename: "dev-shell.py => devshell.py" because of better autocomplete
    • Add DevShellConfig.base_path and use it in own commands like, pytest, linting etc. (So they are usable in external project, too.)
    • recognize "--update" and "--help" arguments better in ./devshell.py calls.
    • Update setuptools on .venv creation, too.
    • Fix Bugs/tests under Windows
  • v0.1.0 - 2021-03-22
    • Fix CI usage: Exit with correct return code if tests failed
    • Better "run as CLI" implementation via new run_cmd2_app()
    • Bugfix errors that only occur on Windows.
    • Simplify devshell.py boot script and fix raise error if ensurepip missing
  • v0.0.2 - 2021-03-19
    • refactor colorful shortcuts
    • display subprocess calls with separated colors
  • v0.0.1 - 2021-03-19
    • first "useable" version

Project links

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

dev-shell-0.2.0rc1.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

dev_shell-0.2.0rc1-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file dev-shell-0.2.0rc1.tar.gz.

File metadata

  • Download URL: dev-shell-0.2.0rc1.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for dev-shell-0.2.0rc1.tar.gz
Algorithm Hash digest
SHA256 e36aace65a778f2e9689a47229c86872a2e5884ee651f5802022a774c75174ba
MD5 7c990ca8a6fe6e7290dcf73ac65f4d9f
BLAKE2b-256 223956fc5cbb6e168bdbcd13d9fdbe67eee9dcf8ed81c3e7f721e04d67e2acf0

See more details on using hashes here.

Provenance

File details

Details for the file dev_shell-0.2.0rc1-py3-none-any.whl.

File metadata

  • Download URL: dev_shell-0.2.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for dev_shell-0.2.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 74ac0eabef35da80f0a24064403ff40b1cfe76c42dd920974d69b57f53c3ce3f
MD5 8cbf232cd640ab41dbef2096a4715a7f
BLAKE2b-256 2627b031426aeafdfb8ac1abf59b1cd687e1107ee7b6266c5d9b179ae6a6a6d0

See more details on using hashes here.

Provenance

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