Skip to main content

Print a pull request title with labels derived from the topic branch name.

Project description

1. Environment

  • Python 3.14.6
  • pip 26.1.2

2. Installation

$ pipx install spreen-pr

(pip install spreen-pr works too if you prefer managing the environment yourself.)

For development, install the dependencies via requirements.txt:

$ pip install -r requirements.txt

3. Execution

$ pr-title hayat01sh1da/issue-89/service/improve-onboarding-flow
[service] Improve Onboarding Flow

With no argument, the current git branch is used:

$ git switch hayat01sh1da/issue-90/hotfix/service/fix_login_crash
$ pr-title
[Hotfix][service] Fix Login Crash

--format json exposes the labels separately for scripting and CI:

$ pr-title hayat01sh1da/issue-90/hotfix/service/fix_login_crash --format json
{"title": "[Hotfix][service] Fix Login Crash", "labels": ["Hotfix", "service"]}

As a library:

from spreen_pr import Application

Application.run(branch_name='hayat01sh1da/issue-89/service/improve-onboarding-flow')
# => '[service] Improve Onboarding Flow'

application = Application(branch_name='hayat01sh1da/issue-90/hotfix/service/fix_login_crash')
application.title   # => '[Hotfix][service] Fix Login Crash'
application.labels  # => ['Hotfix', 'service']

4. Unit Test

$ pytest
============================= test session starts ==============================
platform linux -- Python 3.14.6, pytest-9.1.1, pluggy-1.6.0
rootdir: spreen-pr/pypi
configfile: pyproject.toml
collected 15 items

test/test_application.py .........                                       [ 60%]
test/test_cli.py ......                                                  [100%]

============================== 15 passed in 0.12s ===============================

5. Static Code Analysis

$ flake8 .
$ autoflake8 --in-place --remove-duplicate-keys --remove-unused-variables --recursive .
$ autopep8 --in-place --aggressive --aggressive --recursive .

6. Type Checks

$ mypy .
Success: no issues found in 6 source files

7. Build

$ python -m build
$ pipx install ./dist/spreen_pr-0.1.0-py3-none-any.whl

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

spreen_pr-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spreen_pr-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file spreen_pr-0.1.0.tar.gz.

File metadata

  • Download URL: spreen_pr-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for spreen_pr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cbc708978cabc4ac468f726b95a1e54fafbd3bd8cb741d6e7b365b90c66f4ed4
MD5 311d107c5f955ab9e2188ed71352cbf7
BLAKE2b-256 6008f69414bc2ba3d3b68e72e0c6cc0b5b70b01db2e2ab799ef30672e7de0948

See more details on using hashes here.

File details

Details for the file spreen_pr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spreen_pr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for spreen_pr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be13549bf7f3062ff4c718c92091917f65cbbdaab4a2d90267056f8cd70d6996
MD5 d3aaed34256166097561d3aceeb01d63
BLAKE2b-256 cfbc3dc5c8dfa2fa503d0b2af9bfc05fcae3c5bfcf0bf053fa028674011b181c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page