Skip to content

Commit 9d3efc2

Browse files
authored
Merge pull request #84 from eli64s/refactor/reduce-package-dependencies
Core Logic and Dependency Optimizations
2 parents 18410d9 + c23a977 commit 9d3efc2

31 files changed

+654
-757
lines changed

Makefile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,35 @@
33
SHELL := /bin/bash
44
VENV := readmeai
55

6-
.PHONY: help clean format lint conda-recipe git-rm-cache test poetry-reqs word-search
6+
.PHONY: help clean format lint conda-recipe git-rm-cache nox pytest poetry-reqs word-search
77

88
help:
99
@echo "Commands:"
1010
@echo "clean : repository file cleanup."
1111
@echo "format : executes code formatting."
1212
@echo "lint : executes code linting."
13-
@echo "conda-recipe : builds conda package."
13+
@echo "conda-recipe : builds conda package."
1414
@echo "git-rm-cache : fix git untracked files."
15-
@echo "test : executes tests."
15+
@echo "nox : executes nox test suite."
16+
@echo "pytest : executes tests."
1617
@echo "poetry-reqs : generates requirements.txt file."
1718
@echo "word-search : searches for a word in the repository."
1819

1920
.PHONY: clean
2021
clean: format
22+
@echo -e "\nFile clean up in directory: ${CURDIR}"
2123
./scripts/clean.sh clean
2224

2325
.PHONY: format
2426
format:
2527
@echo -e "\nFormatting in directory: ${CURDIR}"
26-
black ${CURDIR}
27-
isort ${CURDIR}
28+
ruff check --select I --fix .
29+
ruff format .
2830

2931
.PHONY: lint
3032
lint:
3133
@echo -e "\nLinting in directory: ${CURDIR}"
32-
flake8 ${CURDIR}
33-
ruff ${CURDIR}
34+
ruff check . --fix
3435

3536
.PHONY: conda-recipe
3637
conda-recipe:
@@ -41,8 +42,12 @@ conda-recipe:
4142
git-rm-cache:
4243
git rm -r --cached .
4344

44-
.PHONY: test
45-
test:
45+
.PHONY: nox
46+
nox:
47+
nox -f noxfile.py
48+
49+
.PHONY: pytest
50+
pytest:
4651
pytest \
4752
-n auto \
4853
--cov=./ \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ poetry run python3 -m readmeai.cli.commands -o readme-ai.md -r https://github.co
431431

432432
Use [`pytest`](https://docs.pytest.org/en/7.1.x/contents.html) to run the default test suite.
433433
```sh
434-
make test
434+
make pytest
435435
```
436436

437437
Use [`nox`](https://nox.thea.codes/en/stable/) to run the test suite against multiple Python versions including `(3.9, 3.10, 3.11, 3.12)`.

poetry.lock

Lines changed: 1 addition & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "readmeai"
7-
version = "0.4.992"
7+
version = "0.4.993"
88
description = "🎈 Automated README file generator, powered by GPT language model APIs"
99
authors = ["Eli <0x.eli.64s@gmail.com>"]
1010
license = "MIT"
@@ -39,59 +39,68 @@ readmeai = "readmeai.cli.commands:commands"
3939

4040
[tool.poetry.dependencies]
4141
python = "^3.8.1,<4.0.0"
42-
aiohttp = "^3.8.5"
43-
cachetools = "^5.3.1"
42+
aiohttp = "*"
4443
click = "^8.1.7"
4544
colorlog = "^6.7.0"
4645
gitpython = "^3.1.31"
47-
httpx = "^0.24.1"
48-
h2 = "^4.1.0"
4946
openai = "^0.27.8"
5047
pyyaml = "^6.0"
51-
tabulate = "^0.9.0"
5248
tenacity = "^8.2.2"
5349
tiktoken = "^0.4.0"
5450
toml = "^0.10.2"
5551
pydantic = ">=1.10.9,<2.0.0"
5652
setuptools = "^69.0.3"
5753

58-
[tool.poetry.dev-dependencies]
54+
[tool.poetry.group.dev.dependencies]
55+
ruff = "*"
56+
57+
[tool.poetry.group.test.dependencies]
5958
pytest = "*"
6059
pytest-asyncio = "*"
6160
pytest-cov = "*"
6261
pytest-randomly = "*"
6362
pytest-sugar = "*"
6463
pytest-xdist = "*"
65-
ruff = "*"
6664

6765
[tool.poetry.group.docs.dependencies]
6866
mkdocs = "*"
6967
mkdocs-material = "*"
7068

71-
[tool.black]
69+
70+
[tool.ruff]
71+
exclude = [
72+
".ipynb_checkpoints",
73+
".mypy_cache",
74+
".nox",
75+
".pytest_cache",
76+
".ruff_cache",
77+
".vscode",
78+
]
7279
line-length = 79
73-
include = '\.pyi?$'
74-
exclude = '''
75-
/(
76-
.eggs
77-
| .git
78-
| .hg
79-
| .mypy_cache
80-
| .tox
81-
| venv
82-
| _build
83-
| buck-out
84-
| build
85-
| dist
86-
| notebooks
87-
)/
88-
'''
89-
virtual_env = "poetry"
9080

91-
[tool.flake8]
92-
max-line-length = 79
93-
extend-ignore = ["E203", "W503"]
94-
exclude = ".venv,.git,.nox,docs,venv,bin,lib,deps,build,tests,examples,notebooks"
81+
[tool.ruff.format]
82+
quote-style = "double"
83+
docstring-code-format = true
84+
docstring-code-line-length = 20
85+
86+
[tool.ruff.lint]
87+
select = [
88+
# pycodestyle
89+
"E",
90+
# Pyflakes
91+
"F",
92+
# pyupgrade
93+
"UP",
94+
# flake8-bugbear
95+
"B",
96+
# flake8-simplify
97+
"SIM",
98+
# isort
99+
"I",
100+
]
101+
ignore = [
102+
"E501", # Line too long
103+
]
95104

96105
[tool.isort]
97106
line_length = 79

readmeai/cli/options.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
import os
6-
from typing import Optional
76

87
import click
98
from click import Context, Parameter
@@ -12,26 +11,11 @@
1211

1312

1413
def prompt_for_custom_image(
15-
context: Optional[Context],
16-
parameter: Optional[Parameter],
17-
value: Optional[str],
14+
context: Context | None,
15+
parameter: Parameter | None,
16+
value: str | None,
1817
) -> str:
19-
"""Prompts the user to input a custom image URL.
20-
21-
Parameters
22-
----------
23-
ctx
24-
Click context object.
25-
param
26-
Click parameter object.
27-
value
28-
Value of the parameter.
29-
30-
Returns
31-
-------
32-
str
33-
Custom image URL.
34-
"""
18+
"""Prompt the user for a custom image URL."""
3519
if value == ImageOptions.CUSTOM.name:
3620
return click.prompt("Enter the URL for your custom image logo")
3721
elif value in ImageOptions.__members__:

0 commit comments

Comments
 (0)