Skip to content

Commit

Permalink
Update pypi build settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Aug 29, 2023
1 parent 5f13c3e commit 452b314
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 39 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

43 changes: 18 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[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 <[email protected]>"]
license = "MIT"
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",
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -75,6 +76,7 @@ extend-select = [
"PTH", # flake8-use-pathlib
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports

]

[tool.ruff.isort]
Expand All @@ -84,19 +86,10 @@ 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"
addopts = "--strict-markers --disable-pytest-warnings"

[tool.coverage.run]
omit = ["tests/*", "*/__init__.py"]

[tool.setuptools.package-data]
"readmeai.conf" = ["**/*.toml"]
10 changes: 2 additions & 8 deletions readmeai/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 452b314

Please sign in to comment.