Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set version
run: |
poetry version "${{ needs.tag.outputs.new-version }}"
run: poetry version "${{ needs.tag.outputs.new-version }}"
- name: Publish
run: |
poetry publish --build
run: poetry publish --build
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `draft(1)`
# `git-draft(1)`

WIP
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ requires = ['poetry-core']
build-backend = 'poetry.core.masonry.api'

[tool.poetry]
name = 'draft'
name = 'git-draft'
version = '0.0.0' # Set programmatically
description = 'Version-controlled code assistant'
authors = ['Matthieu Monsch <[email protected]>']
readme = 'README.md'
repository = 'https://github.com/mtth/draft'
packages = [{include = 'draft', from = 'src'}]
packages = [{include = 'git_draft', from = 'src'}]

[tool.poetry.scripts]
git-draft = 'git_draft.__main__:main'

[tool.poetry.dependencies]
python = '>=3.12,<4'
Expand Down
File renamed without changes.
32 changes: 19 additions & 13 deletions src/draft/__main__.py → src/git_draft/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import optparse

parser = optparse.OptionParser(prog="draft")

parser = optparse.OptionParser(prog="git-draft")

parser.disable_interspersed_args()

Expand Down Expand Up @@ -67,15 +68,20 @@ def __call__(self, _option, _opt, value, parser, name) -> None:
Command.register("delete", help="delete the current draft")


(opts, args) = parser.parse_args()
command = getattr(opts, "command", None)
if command == "create":
print("Creating draft...")
elif command == "prompt":
print("Updating draft...")
elif command == "apply":
print("Applying draft...")
elif command == "delete":
print("Deleting draft...")
else:
parser.error("missing command")
def main() -> None:
(opts, args) = parser.parse_args()
command = getattr(opts, "command", None)
if command == "create":
print("Creating draft...")
elif command == "prompt":
print("Updating draft...")
elif command == "apply":
print("Applying draft...")
elif command == "delete":
print("Deleting draft...")
else:
parser.error("missing command")


if __name__ == "__main__":
main()
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import draft.backend as sut
import git_draft.backend as sut


def test_backend():
Expand Down