Skip to main content

Slap is a command-line utility for developing Python applications.

Project description

Slap

Slap is a command-line tool to simplify common workflows in the development of Python projects independent of the PEP 517 build backend being used, capable of managing single- and multi-project repositories.

Installation

I recommend installing Slap using Pipx. (Requires Python 3.10 or higher)

$ pipx install slap-cli

Note: Currently Slap relies on an alpha version of poetry-core (^1.1.0a6). If you install it into the same environment as Poetry itself, you may also need to use an alpha version of Poetry (e.g. 1.2.0a2).

If you use Slap in GitHub Actions, try one of the actions provided by Slap directly:

Documentation

You can find the documentation for Slap here: https://niklasrosenstein.github.io/slap/

Check out the Getting started guide.

Feature Matrix

Feature Poetry Documentation
Manage structured changelog entries slap changelog
Show project details slap info
Build and publish to PyPI using Twine ✅ (single project only) slap publish
Create a new release (bump version numbersr) ❌ (sub-par support) slap release
Run a command configured in pyproject.toml slap run
Run tests configured in pyproject.toml slap test
Manage Python virtualenv's ✅ (but out-of-worktree) slap venv
Generate a dependencies report slap report dependencies
Project dependencies lock file
Feature / Build backend Flit Poetry Setuptools Documentation
Add dependency slap add
Sanity check project configuration slap check
Bootstrap project files slap init
Install projects using Pip slap install
Symlink projects (editable installs) slap link
Bump interdependencies in mono-repository ✅ (not tested regularly) ✅ (partial) slap release

Legend: ✅ explicitly supported, ❌ explicitly not supported, (blank) not relevant or currently not supported

Issues / Suggestions / Contributions

Slap is currently very opinionated by the fact that I built it as my personal workflow tool, but I welcome suggestions and contributions, and I am hopeful it will be useful to a wider audience than myself.

Please report any issues you encounter via GitHub Issues. Feel free to use the GitHub Discussions forum to ask questions or make suggestions on new features (e.g. if you would like a new build backend to be supported?). Lastly, feel free to submit pull requests to the GitHub Repository.

FAQ

Why "Slap"?

Finding a good, catchy name that also types easily in the terminal and is not already widely used isn't easy, ok?

What makes this different to the Poetry CLI?

Some people might find this similar to tools like Poetry, and while there is some overlap in functionality, Slap is not a build backend and is more targeted towards library development. In fact, most of my projects use Poetry as the build backend but I never even once interact with the Poetry CLI throughout the lifetime of the project.

The most notable differences to Poetry are

  • Supports mono-repositories (i.e. multiple related Python projects in the same repository), to the extent that it bumps version numbers of project inter-dependencies and installs your projects in topological order
  • Supports development installs independent of the build backend (yes; this means you can install Poetry packages in editable mode even though the Poetry backend right now does not support editable installs)
  • Slap's version bump command (slap release) updates the version not just in your pyproject.toml but also the __version__ in your source code as well as in related projects (see mono-repositories above) and any additional references you can configure via Regex patterns
  • Does not automagically create a virtual environment for you when instal your project(s); instead, it errors when you try to install into a non-virtual Python environment and gives you an easy-to-use tool to create and activate virtual environments (and allowing multiple environments per project as well as global environments)
  • Uses Pip to install your project(s), unlike Poetry which comes with its own dependency resolver and package installer (which I personally have been having a lot of issues with in the past).
  • Does not have a concept of lock files

Project details


Release history Release notifications | RSS feed

This version

1.7.0

Download files

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

Source Distribution

slap_cli-1.7.0.tar.gz (80.7 kB view details)

Uploaded Source

Built Distribution

slap_cli-1.7.0-py3-none-any.whl (101.6 kB view details)

Uploaded Python 3

File details

Details for the file slap_cli-1.7.0.tar.gz.

File metadata

  • Download URL: slap_cli-1.7.0.tar.gz
  • Upload date:
  • Size: 80.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.2

File hashes

Hashes for slap_cli-1.7.0.tar.gz
Algorithm Hash digest
SHA256 d79bce86a6571e39b2c059c3854abc96f08b6c5eaa7e7b5c14d0bf2f41caf9b8
MD5 b88304dffb80236cdb35877bae831763
BLAKE2b-256 c85fed2aa4e2a9318660b0fad31116726988e810268fdb6212d32b839bfdfa3b

See more details on using hashes here.

File details

Details for the file slap_cli-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: slap_cli-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 101.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.2

File hashes

Hashes for slap_cli-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae098ef93b4cfecf1ae97922bc3add3132cbf8b300f94d22f55f9258e8da8b1
MD5 ce8af7331f9234f54fff8a49c140668c
BLAKE2b-256 3fdf12de1bb270679f15f03a0db24eb2a20bb637527066314f7b3890148d251f

See more details on using hashes here.

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