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 ae3851c commit 75dd2b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: python -m build
- name: Publish package
run: |
python -m twine upload --skip-existing dist/*
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["poetry-core"]
requires = ["poetry-core>=1.0.0", "setuptools>=40.8.0", "wheel", "toml"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "readmeai"
version = "0.1.9992"
version = "0.2.001"
description = "🚀 Generate awesome README.md files from the terminal, powered by OpenAI's GPT language model APIs 💫"
authors = ["Eli <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -32,6 +32,7 @@ keywords = [
"llm-prompting",
"llm-agent",
]
include = ["readmeai/conf/*.toml"]

[tool.poetry.dev-dependencies]
black = "*"
Expand Down
10 changes: 8 additions & 2 deletions readmeai/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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 @@ -214,8 +215,13 @@ def __post_init__(self):

def _get_config_dict(handler: factory.FileHandler, filename: str) -> dict:
"""Get configuration dictionary from TOML file."""
path = Path("conf/") / filename
return handler.read(path)
try:
import toml

data = pkg_resources.resource_string(__name__, filename)
return toml.loads(data.decode("utf-8"))
except FileNotFoundError:
raise


def load_config(path: str = "conf.toml") -> AppConfig:
Expand Down

0 comments on commit 75dd2b6

Please sign in to comment.