Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PACKAGE-1] Package to PIP #84

Merged
merged 32 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
081adac
chore: port changes from test-1
seyLu Oct 22, 2023
60febe8
feat: project rename
seyLu Oct 22, 2023
83a6cce
chore: clean up deps
seyLu Oct 22, 2023
2c8d56d
feat: build with hatchling, build and upload dist using twine
seyLu Oct 22, 2023
744f4d7
Merge branch 'main' into feat/PACKAGE-1
seyLu Oct 22, 2023
9557d53
feat: move deps to src
seyLu Oct 22, 2023
ec348e3
feat: add entry point
seyLu Oct 22, 2023
98dcb8e
feat: add deps to pyproject.toml and resolve path shenanigans
seyLu Oct 22, 2023
a7cfa53
feat: add deps to pyproject.toml and resolve path shenanigans
seyLu Oct 22, 2023
a45dbfa
chore: change color of project name in version callback
seyLu Oct 22, 2023
4773399
docs: update README
seyLu Oct 22, 2023
29e3c30
docs: add basic usage
seyLu Oct 22, 2023
b1c2e77
docs: add advanced usage
seyLu Oct 22, 2023
973413b
feat: rename PERSONAL_ACCESS_TOKEN to just TOKEN
seyLu Oct 22, 2023
d9d550d
docs: add short -h command on setup and dump
seyLu Oct 22, 2023
748e786
docs: update alt text of icon
seyLu Oct 22, 2023
907325d
chore: revert version to 0.0.1
seyLu Oct 22, 2023
38a93a9
feat: add dynamic versioning
seyLu Oct 22, 2023
e15f858
docs: update basic usage
seyLu Oct 22, 2023
05b7544
chore: move build-system up
seyLu Oct 22, 2023
18ec43d
feat: add bandit to ruff config
seyLu Oct 22, 2023
c47e856
chore: reformat
seyLu Oct 22, 2023
2fc4fdc
chore: reformat
seyLu Oct 22, 2023
3f7f492
feat: add pre-commit prettier
seyLu Oct 23, 2023
ceaeae3
feat: add ruff config flake8-builtins
seyLu Oct 23, 2023
284c8bb
feat: add ruff config flake8-builtins
seyLu Oct 23, 2023
f1e8e40
feat: add more ruff rules and add HTTPError request exception handling
seyLu Oct 23, 2023
335c72a
feat (pre-commit): deprecate black in favor of ruff format
seyLu Feb 14, 2024
75ab1ff
chore: remove unecessary main function
seyLu Feb 14, 2024
142f200
Merge branch 'main' into feat/PACKAGE-1
seyLu Feb 14, 2024
ffdeb0e
Merge branch 'main' into feat/PACKAGE-1
seyLu Mar 29, 2024
2d1d5b2
ci (lint): deprecate black in favor of ruff
seyLu Mar 29, 2024
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
2 changes: 0 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,3 @@ jobs:
mypy .
--install-types
--non-interactive
--check-untyped-defs
--ignore-missing-imports
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div align="center">
<img height=100 src="https://github.com/seyLu/setup-issue-label-cli/blob/main/static/icons/labels.png" alt="Setup Github Label CLI Icon">
<img height=100 src="https://github.com/seyLu/ghlabel/blob/main/labels.png" alt="Setup Github Label CLI Icon">
<h1Github Label CLI</h1>
<p>CLI tool to help setup Github Labels from a yaml/json config file.</p>
<p>
<a href="https://github.com/seyLu/setup-issue-label-cli/issues/new">Report Bug</a>
<a href="https://github.com/seyLu/ghlabel/issues/new">Report Bug</a>
·
<a href="https://github.com/seyLu/setup-issue-label-cli/issues/new">Request Feature</a>
<a href="https://github.com/seyLu/ghlabel/issues/new">Request Feature</a>
·
<a href="https://github.com/seyLu/setup-issue-label-cli/discussions">Ask Question</a>
<a href="https://github.com/seyLu/ghlabel/discussions">Ask Question</a>
</p>
</div>

Expand All @@ -26,7 +26,7 @@ python==3.11
#### 1. Clone the repo

```bash
git clone git@github.com:seyLu/setup-github-label-cli.git
git clone https://github.com/seyLu/ghlabel.git
```

#### 2. Install dependencies
Expand Down Expand Up @@ -186,7 +186,7 @@ ghlabel setup -r "Type: Feature Request, Type: Bug"
```bash
# -a [valid json string]
# will be parsed as list[dict[str, str]]
ghlabel setup -a "[{'name': 'wontfix', 'color': '##ffffff'}, {'name': 'bug', 'color': '#d73a4a', 'description': 'Something isn't working'}]"
ghlabel setup -a "[{'name': 'wontfix', 'color': '#ffffff'}, {'name': 'bug', 'color': '#d73a4a', 'description': 'Something isn't working'}]"
```

<br>
Expand Down
2 changes: 1 addition & 1 deletion ghlabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ ghlabel setup -r "Type: Feature Request, Type: Bug"
```bash
# -a [valid json string]
# will be parsed as list[dict[str, str]]
ghlabel setup -a "[{'name': 'wontfix', 'color': '##ffffff'}, {'name': 'bug', 'color': '#d73a4a', 'description': 'Something isn't working'}]"
ghlabel setup -a "[{'name': 'wontfix', 'color': '#ffffff'}, {'name': 'bug', 'color': '#d73a4a', 'description': 'Something isn't working'}]"
```
File renamed without changes
28 changes: 20 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
[project]
name = "python-template"
version = "0.0.1"
name = "ghlabel"
version = "0.0.2"
# Support Python 3.11.
requires-python = "==3.11"
requires-python = ">=3.11"
license = "MIT"
authors = [
{name = "MJ Sabit (seyLu)", email = "98249191+seyLu@users.noreply.github.com"},
]
description = "CLI tool to help setup Github Labels from a yaml/json config file."
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
"Homepage" = "https://github.com/seyLu/ghlabel"
"Bug Tracker" = "https://github.com/seyLu/ghlabel/issues"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"


[tool.ruff]
Expand All @@ -29,14 +44,11 @@ unfixable = ["B"]
"path/to/file.py" = ["E402"]


[tool.isort]
# Automatically apply black to isort.
profile = "black"


[tool.mypy]
strict = "True"
implicit_reexport = "True"
check_untyped_defs = true
ignore_missing_imports = true

# Exclude type checking on files/dirs
exclude = [
Expand Down
34 changes: 11 additions & 23 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
certifi==2023.7.22
cfgv==3.4.0
charset-normalizer==3.3.0
click==8.1.7
colorama==0.4.6
distlib==0.3.7
filelock==3.12.4
identify==2.5.30
idna==3.4
markdown-it-py==3.0.0
mdurl==0.1.2
nodeenv==1.8.0
platformdirs==3.11.0
pre-commit==3.5.0
Pygments==2.16.1
python-dotenv==1.0.0
PyYAML==6.0.1
requests==2.31.0
rich==13.6.0
shellingham==1.5.3
# core
typer==0.9.0
typing_extensions==4.8.0
urllib3==2.0.7
virtualenv==20.24.5
requests==2.31.0
python-dotenv==1.0.0

# packaging
hatchling==1.18.0
build==1.0.3
twine==4.0.2

# dev tools
pre-commit==3.5.0
File renamed without changes.
12 changes: 8 additions & 4 deletions cli.py → src/ghlabel/ghlabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@

import typer
from rich.progress import Progress, SpinnerColumn, TextColumn

from scripts.dump_label import DumpLabel
from scripts.setup_github_label import GithubConfig, GithubLabel
from util.dump_label import DumpLabel
from util.setup_github_label import GithubConfig, GithubLabel


def parse_remove_labels(labels: str | None) -> list[str] | None:
Expand Down Expand Up @@ -59,7 +58,12 @@ class RemoveAllChoices(str, Enum):
silent = "silent"


app = typer.Typer(add_completion=False)
app = typer.Typer(
add_completion=False,
context_settings={
"help_option_names": ["-h", "--help"],
},
)


@app.command("setup", help="Add/Remove Github labels from config files.") # type: ignore[misc]
Expand Down
Empty file added src/ghlabel/util/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.