From 452b314cec59ecf19ef5e84d4c2d4be2d7d245dc Mon Sep 17 00:00:00 2001 From: Eli <43382407+eli64s@users.noreply.github.com> Date: Tue, 29 Aug 2023 11:08:35 -0500 Subject: [PATCH] Update pypi build settings. --- .github/workflows/build_package.yaml | 5 ++-- MANIFEST.in | 3 -- pyproject.toml | 43 ++++++++++++---------------- readmeai/conf.py | 10 ++----- 4 files changed, 22 insertions(+), 39 deletions(-) delete mode 100644 MANIFEST.in diff --git a/.github/workflows/build_package.yaml b/.github/workflows/build_package.yaml index 27e107e9..88737c18 100644 --- a/.github/workflows/build_package.yaml +++ b/.github/workflows/build_package.yaml @@ -23,10 +23,9 @@ jobs: pip install build pip install twine - name: Build package - run: python -m build --sdist --wheel . + run: python -m build - name: Publish package - run: | - python -m twine upload dist/* + run: python -m twine upload --skip-existing dist/* env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 9d59708c..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include LICENSE -include README.md -recursive-include readmeai *.toml diff --git a/pyproject.toml b/pyproject.toml index feafe18c..1a1ddf71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["poetry-core>=1.0.0", "setuptools>=40.8.0", "wheel"] +requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry] name = "readmeai" -version = "0.2.2" +version = "0.2.24" description = "🚀 Generate awesome README.md files from the terminal, powered by OpenAI's GPT language model APIs 💫" authors = ["Eli <0x.eli.64s@gmail.com>"] license = "MIT" @@ -12,9 +12,10 @@ readme = "README.md" homepage = "https://github.com/eli64s/readme-ai" documentation = "https://github.com/eli64s/readme-ai/blob/main/README.md" keywords = [ + "markdown", "readme", - "python-cli", "readme-template", + "shieldsio", "readme-md", "awesome-readme", "readme-generator", @@ -24,23 +25,17 @@ keywords = [ "auto-readme", "gpt-4", "llms", + "awesome-chatgpt", "openai-python", "chatgpt-python", + "openai-chatbot", "gpt-35-turbo", "gpt-4-api", - "openai-cli", - "llm-prompting", - "llm-agent", + "llm-agent" ] -[tool.poetry.dev-dependencies] -black = "*" -flake8 = "*" -isort = "*" -pytest = "*" -pytest-cov = "*" -pre-commit = "*" -ruff = "*" +[tool.poetry.scripts] +readmeai = "readmeai.main:cli" [tool.poetry.dependencies] python = "^3.8.1" @@ -59,8 +54,14 @@ toml = "^0.10.2" pydantic = "^1.10.9" click = "^8.1.6" -[tool.poetry.scripts] -readmeai = "readmeai.main:cli" +[tool.poetry.dev-dependencies] +black = "*" +flake8 = "*" +isort = "*" +pytest = "*" +pytest-cov = "*" +pre-commit = "*" +ruff = "*" [tool.ruff] line-length = 88 @@ -75,6 +76,7 @@ extend-select = [ "PTH", # flake8-use-pathlib "SIM", # flake8-simplify "TID", # flake8-tidy-imports + ] [tool.ruff.isort] @@ -84,12 +86,6 @@ split-on-trailing-comma = false [tool.ruff.flake8-tidy-imports] ban-relative-imports = "all" -[tool.isort] -profile = "black" -line_length = 88 -multi_line_output = 3 -include_trailing_comma = true - [tool.pytest.ini_options] testpaths = ["tests"] python_files = "test_*.py" @@ -97,6 +93,3 @@ addopts = "--strict-markers --disable-pytest-warnings" [tool.coverage.run] omit = ["tests/*", "*/__init__.py"] - -[tool.setuptools.package-data] -"readmeai.conf" = ["**/*.toml"] diff --git a/readmeai/conf.py b/readmeai/conf.py index 7b775163..ca9c59c3 100644 --- a/readmeai/conf.py +++ b/readmeai/conf.py @@ -8,7 +8,6 @@ from urllib.parse import urlparse, urlsplit import openai -import pkg_resources from pydantic import BaseModel, Field, SecretStr, validator from . import factory, logger @@ -215,13 +214,8 @@ def __post_init__(self): def _get_config_dict(handler: factory.FileHandler, filename: str) -> dict: """Get configuration dictionary from TOML file.""" - try: - import toml - - data = pkg_resources.resource_string(__name__, filename) - return toml.loads(data.decode("utf-8")) - except FileNotFoundError: - raise + path = Path("conf/") / filename + return handler.read(path) def load_config(path: str = "conf.toml") -> AppConfig: