Skip to main content

A program to help build, maintain, and release PEP 517-compliant projects.

Project description

bork Build Status PyPI Documentation Status

A frontend for building and releasing PEP 517 compliant projects, including support for generating a ZipApp.

Includes a basic task runner, in the form of bork run <task name>. Tasks are defined in your pyproject.toml file.

Bork requires Python 3.8 or newer.

Installation

$ pip3 install bork

Or download the latest zipapp releases

Usage

Example usage information is provided below. Additional documentation can be found at bork.readthedocs.io.

Downloading Existing Builds

To download a release from GitHub:

$ bork download gh:duckinator/emanate # download latest .pyz for Emanate
$ bork download gh:duckinator/emanate --directory bin/ # put files in ./bin
$ bork download gh:ppb/pursuedpybear --files '*.tar.gz' # download latest .tar.gz file

To download a wheel from a PyPi release:

$ bork download pypi:emanate 6.0.0 --files '*.whl'

To download a wheel from a release on PyPi's test instance:

$ bork download testpypi:whaledo 1.0.1 --files '*.whl'

Building and Releasing

Assuming a project is PEP 517 compliant, you can just do:

$ bork clean # Remove anything in build/, dist/, *.egg-info/
$ bork build # Build the project
$ bork release # Release to PyPI

ZipApp Support

If you want to build a ZipApp, add this to your pyproject.toml:

[tool.bork.zipapp]
enabled = true
main = "<entrypoint>"

Where <entrypoint> is of the form "module.submodule:function", and may be equivalent to a console_script entrypoint in setup.cfg.

NOTE: ZipApps will only be compressed when using Python 3.7 and later. This means ZipApps created with older versions may be significantly larger.

Uploading To GitHub Releases

If you want to upload assets to GitHub Releases, you can add the following configuration to your pyproject.toml:

[project]
name = "<project name>"

[tool.bork.release]
# If true, release to PyPi; otherwise, don't.
pypi = true
# If true, release to GitHub; otherwise, don't.
github = true # release to GitHub
# GitHub repository, e.g. "duckinator/bork".
github_repository = "<owner>/<repo>"
# List of file globs to include in GitHub Releases.
github_release_globs = ["dist/*.pyz", "dist/*.whl"]
# If true, zipapps are named "<name>.pyz", otherwise "<name>-<version>.pyz".
strip_zipapp_version = true

Aliases (Basic task runner)

Bork includes a very basic task runner, for single-line commands.

As an example, here is what Bork uses:

[tool.bork.aliases]
lint = [
    "pylint bork tests",
    "mypy bork",
]
# Runs all tests.
test = "pytest --verbose"
# Runs fast tests.
test-fast = "pytest --verbose -m 'not slow'"
# Runs slow tests.
test-slow = "pytest --verbose -m slow"
# Build docs
docs = "mkdocs build"

Then you can run bork aliases to get the list of aliases:

~/bork$ bork aliases
lint
test
test-fast
test-slow
~/bork$

And run bork run <alias> to run that alias:

~/bork$ bork run docs
mkdocs build
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: /usr/home/puppy/bork/site
INFO     -  Documentation built in 0.25 seconds
~/bork$

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/duckinator/bork. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

The code for Bork is available under the MIT License.

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

bork-9.0.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

bork-9.0.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file bork-9.0.0.tar.gz.

File metadata

  • Download URL: bork-9.0.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: bork/9.0.0 (+https://github.com/duckinator/bork)

File hashes

Hashes for bork-9.0.0.tar.gz
Algorithm Hash digest
SHA256 099fcb54afb5f71eda829cf41ef4f7f12cfe43604ff094a29a88a4bc2a1f6512
MD5 06b4705363aae1a420a0e8fd9553cf09
BLAKE2b-256 e523b95e1b14a9a9be43f8629a0b54a9e7abf4255bd2242d296c6a7bafc0266b

See more details on using hashes here.

File details

Details for the file bork-9.0.0-py3-none-any.whl.

File metadata

  • Download URL: bork-9.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: bork/9.0.0 (+https://github.com/duckinator/bork)

File hashes

Hashes for bork-9.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 917d684eebf1b4ff9b5bff92e93f2d3d220e39299e3c765c1c6dc06d1d168d07
MD5 4dcfc05830c1f5dc638523567d0fb49b
BLAKE2b-256 51a5d64a66507e520e87b5ad056b9ff94254a9fd5a448af9df932e9df48a346a

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