Skip to main content

Enforce a triangular Git workflow. If this is not possible, explain why.

Project description

Samosa (समोसा)

Enforce a triangular Git workflow. If this is not possible, explain why.

Usage

Usage: samosa [OPTIONS] COMMAND [ARGS]...

  Enforce a triangular Git workflow. If this is not possible, explain why.

Options:
  --help  Show this message and exit.

Commands:
  add       Add remote to repository.
  checkout  Check out a new or existing branch.
  fix       Prepare repository.
  init      Initialise an empty local repository.

Samosa will always prepare a repository before attempting a command. If all checks pass, the command is executed. Otherwise, Samosa will make a suggestion and terminate with exit code 1 (error).

Samosa standard

The following checks should be true:

  • In a Git repository
  • There is a remote named "origin"
  • There is a remote named "upstream"
  • Author name and email are set, and are not invalid
  • The default push target is "origin:current"
  • The pre-commit hook exists and is executable
  • There is a local branch named "main"
  • The main branch tracks "upstream/main"

See WORKFLOW.md for a detailed workflow that results in a samosa standard repository.

Suggestions

If you aren't forking, make origin and upstream equal

Forking a project may not be feasible or possible. In this case, set upstream and origin to the same URL.

(Forks may be disallowed for confidential projects. Forking may not be useful for solo maintainers.)

Out of scope

  • Detecting/supporting other workflows.
  • Oh sh*, git!
  • samosa clone (use init then add upstream <url> and add origin <url>)
  • Non-Python packaging. Requires git and libgit2.

Acknowledgements

WORKFLOW.md and the associated pre-commit bash script are derived from Aaron Bull Schaefer's excellent Git Triangular Workflow. License details are included in the relevant files.

Additional references

Alternatives

Development environment

Install prerequisites

  • Python 3.10
  • pdm
  • make
  • pipx (optional, required for make install-source)

Instructions

  • Fork the upstream repository.
  • git clone [fork-url]
  • cd [project-folder]
  • Run make develop to initialise your development environment.

You can use any text editor or IDE that supports virtualenv / pdm. See the Makefile for toolchain details.

Please make test and make lint before submitting changes.

Make targets

USAGE: make [target]

help    : Show this message.
develop : Set up Python development environment.
run     : Run from source.
clean   : Remove all build artefacts.
test    : Run tests and generate coverage report.
lint    : Fix or warn about linting errors.
build   : Clean, test, lint, then generate new build artefacts.
publish : Upload build artefacts to PyPI.
install-source : Install source as a local Python application.

Sharing and contributions

Samosa (समोसा)
https://lofidevops.neocities.org
Copyright 2022 David Seaward and contributors
SPDX-License-Identifier: AGPL-3.0-or-later

Shared under AGPL-3.0-or-later. We adhere to the Contributor Covenant 2.1, and certify origin per DCO 1.1 with a signed-off-by line. Contributions under the same terms are welcome.

Submit security and conduct issues as private tickets. Sign commits with git commit --signoff. For a software bill of materials run reuse spdx. For more details see CONDUCT, COPYING and CONTRIBUTING.

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

samosa-0.2.6.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

samosa-0.2.6-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file samosa-0.2.6.tar.gz.

File metadata

  • Download URL: samosa-0.2.6.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.8.2 CPython/3.10.12

File hashes

Hashes for samosa-0.2.6.tar.gz
Algorithm Hash digest
SHA256 340fceef4eeb5bda64bc5e319f8b94da1e14076f218bf9e26745d2e9532b30df
MD5 7473afcff85f05ecff5b5250b2493c64
BLAKE2b-256 3afd2b132d0ea64857b1d8109560c69c902d1278957bd627179a284a55e10eec

See more details on using hashes here.

File details

Details for the file samosa-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: samosa-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.8.2 CPython/3.10.12

File hashes

Hashes for samosa-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8a30bb8ed0b49e94b067377cfc8d47a4ca99da64e90480745f26a780d0efe606
MD5 c85bd943dc375bed1046a58ed2bda8b9
BLAKE2b-256 6614d326a94c6fb35fbfdc4358e73ef7b7ca4453547a17200889ee71975c888e

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