Skip to content

Commit 60dc0f5

Browse files
committed
‣ Move 'conf' directory under 'readmeai' to fix PyPI installation.
1 parent 3cd9a99 commit 60dc0f5

17 files changed

+283
-268
lines changed

.dockerignore

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
# Exclude markdown files
2-
*.md
3-
4-
# Exclude lock and toml files
5-
poetry.lock
6-
pyproject.toml
1+
# Git and GitHub metadata
2+
.git/
3+
.gitignore
4+
CODE_OF_CONDUCT.md
5+
CONTRIBUTING.md
6+
Makefile
7+
CHANGELOG.md
78

89
# Exclude all .pyc files
910
**/__pycache__
1011

11-
# Exclude all test-related files
12+
# Build artifacts
13+
dist/
14+
*.tar.gz
15+
*.whl
16+
17+
# Test and setup scripts
1218
tests/
19+
setup/
20+
scripts/
1321

14-
# Exclude unnecessary directories and files
15-
CHANGELOG.md
16-
CODE_OF_CONDUCT.md
17-
CONTRIBUTING.md
18-
LICENSE
19-
Makefile
22+
# Jupyter notebooks
2023
notebooks/
24+
25+
# Example files
2126
examples/
22-
setup/environment.yaml

.github/workflows/build_package.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
- name: Build package
2626
run: python -m build
2727
- name: Publish package
28-
run: |
29-
python -m twine upload --skip-existing dist/*
28+
run: python -m twine upload --skip-existing dist/*
3029
env:
3130
TWINE_USERNAME: __token__
3231
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,5 @@ notebooks/
4444
.benchmarks/
4545

4646
# Work In Progress
47-
conf/templates
48-
src/redis_cache.py
49-
conf/prompts.toml
50-
readmeai/app.py
47+
readmeai/conf/templates
48+
readmeai/conf/prompts.toml

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,13 @@ All notable changes to this project will be documented in this file.
112112
- *File Permissions Management:* Explicitly manage file permissions to prevent potential security risks when the image operates in varied contexts.
113113

114114
---
115+
116+
## [v0.0.6] - *2023-08-29*
117+
118+
### 🛠️ Fixed
119+
120+
- Corrected PyPI issue where the *readmeai* package was not being installed correctly.
121+
- The [conf](./readmeai/conf/) directory was not being included in the PyPI distribution as it was located in the project's root directory.
122+
- The tool now uses the [pkg_resources](https://setuptools.pypa.io/en/latest/pkg_resources.html#) module to access the *conf* directory from the *readmeai* package.
123+
124+
---

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Before you begin, ensure that you have the following prerequisites installed:
226226

227227
#### 📂 Repository
228228

229-
Most user's will run *README-AI* using the command-line, specifying their repository on run-time. However, if you would like to use the default configuration, you will need to update the [configuration file](./conf/conf.toml) with your repository's remote URL or a local path to your codebase.
229+
Most user's will run *README-AI* using the command-line, specifying their repository on run-time. However, if you would like to use the default configuration, you will need to update the [configuration file](./readmeai/conf/conf.toml) with your repository's remote URL or a local path to your codebase.
230230

231231
```toml
232232
[git]
@@ -312,7 +312,7 @@ poetry install
312312

313313
### 🎮 Using *README-AI*
314314

315-
Use the command-line to provide the OpenAI API key (if not already set) and specify an output path for your README file, along with the path to your local repository or remote code repository. You can also provide the output path in the [configuration file](./conf/conf.toml)
315+
Use the command-line to provide the OpenAI API key (if not already set) and specify an output path for your README file, along with the path to your local repository or remote code repository. You can also provide the output path in the [configuration file](./readmeai/conf/conf.toml)
316316

317317
Command-Line Arguments:
318318

poetry.lock

+211-216
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+18-22
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "readmeai"
7-
version = "0.1.6"
7+
version = "0.2.3"
88
description = "🚀 Generate awesome README.md files from the terminal, powered by OpenAI's GPT language model APIs 💫"
99
authors = ["Eli <0x.eli.64s@gmail.com>"]
1010
license = "MIT"
1111
readme = "README.md"
1212
homepage = "https://github.com/eli64s/readme-ai"
1313
documentation = "https://github.com/eli64s/readme-ai/blob/main/README.md"
1414
keywords = [
15+
"markdown",
1516
"readme",
16-
"python-cli",
1717
"readme-template",
18+
"shieldsio",
1819
"readme-md",
1920
"awesome-readme",
2021
"readme-generator",
@@ -24,23 +25,18 @@ keywords = [
2425
"auto-readme",
2526
"gpt-4",
2627
"llms",
28+
"awesome-chatgpt",
2729
"openai-python",
2830
"chatgpt-python",
31+
"openai-chatbot",
2932
"gpt-35-turbo",
3033
"gpt-4-api",
31-
"openai-cli",
32-
"llm-prompting",
33-
"llm-agent",
34+
"llm-agent"
3435
]
36+
include = ["readmeai", "readmeai.*"]
3537

36-
[tool.poetry.dev-dependencies]
37-
black = "*"
38-
flake8 = "*"
39-
isort = "*"
40-
pytest = "*"
41-
pytest-cov = "*"
42-
pre-commit = "*"
43-
ruff = "*"
38+
[tool.poetry.scripts]
39+
readmeai = "readmeai.main:cli"
4440

4541
[tool.poetry.dependencies]
4642
python = "^3.8.1"
@@ -59,8 +55,14 @@ toml = "^0.10.2"
5955
pydantic = "^1.10.9"
6056
click = "^8.1.6"
6157

62-
[tool.poetry.scripts]
63-
readmeai = "readmeai.main:cli"
58+
[tool.poetry.dev-dependencies]
59+
black = "*"
60+
flake8 = "*"
61+
isort = "*"
62+
pytest = "*"
63+
pytest-cov = "*"
64+
pre-commit = "*"
65+
ruff = "*"
6466

6567
[tool.ruff]
6668
line-length = 88
@@ -75,6 +77,7 @@ extend-select = [
7577
"PTH", # flake8-use-pathlib
7678
"SIM", # flake8-simplify
7779
"TID", # flake8-tidy-imports
80+
7881
]
7982

8083
[tool.ruff.isort]
@@ -84,13 +87,6 @@ split-on-trailing-comma = false
8487
[tool.ruff.flake8-tidy-imports]
8588
ban-relative-imports = "all"
8689

87-
[tool.isort]
88-
profile = "black"
89-
line_length = 88
90-
multi_line_output = 3
91-
include_trailing_comma = true
92-
virtual_env = ["venv", ".venv", "env", ".env", ".tox", ".nox"]
93-
9490
[tool.pytest.ini_options]
9591
testpaths = ["tests"]
9692
python_files = "test_*.py"

readmeai/builder.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from pathlib import Path
66
from typing import List, Tuple
77

8+
from pkg_resources import resource_filename
9+
810
from . import conf, factory, logger, utils
911

1012
LOGGER = logger.Logger(__name__)
@@ -34,8 +36,7 @@ def create_markdown_sections(
3436
name = config.git.name
3537
repository = config.git.repository
3638
user_repo = utils.get_user_repository_name(repository)
37-
cwd_path = Path.cwd()
38-
badges_path = cwd_path / config.paths.badges
39+
badges_path = resource_filename("readmeai", f"{config.paths.badges}")
3940
badges_dict = factory.FileHandler().read(badges_path)
4041

4142
markdown_badges = config.md.badges.format(

readmeai/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from urllib.parse import urlparse, urlsplit
99

1010
import openai
11+
from pkg_resources import resource_filename
1112
from pydantic import BaseModel, Field, SecretStr, validator
1213

1314
from . import factory, logger
@@ -199,7 +200,7 @@ def __post_init__(self):
199200
]
200201

201202
for path in conf_path_list:
202-
path = Path("conf/").joinpath(path).resolve()
203+
path = Path(resource_filename("readmeai", f"conf/{path}")).resolve()
203204
conf_dict = handler.read(path)
204205

205206
if "dependency_files" in conf_dict:
@@ -214,7 +215,7 @@ def __post_init__(self):
214215

215216
def _get_config_dict(handler: factory.FileHandler, filename: str) -> dict:
216217
"""Get configuration dictionary from TOML file."""
217-
path = Path("conf/") / filename
218+
path = resource_filename("readmeai", f"conf/{filename}")
218219
return handler.read(path)
219220

220221

conf/conf.toml readmeai/conf/conf.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ slogan = "Conceptualize a catchy and memorable slogan for the GitHub project: {}
5959
[md]
6060
default = "`ℹ️ INSERT-DESCRIPTION`"
6161
dropdown = """<details closed><summary>{}</summary>\n\n{}\n\n</details>\n"""
62-
header = """\n<div align="center">
62+
header = """<div align="center">
6363
<h1 align="center">
6464
<img src="https://raw.githubusercontent.com/PKief/vscode-material-icon-theme/ec559a9f6bfd399b82bb44393651661b08aaf7ba/icons/folder-markdown-open.svg" width="100" />
6565
<br>{}
File renamed without changes.

conf/ignore_files.toml readmeai/conf/ignore_files.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ files = [
145145
".gitignore",
146146
".whitesource",
147147
".prettierrc",
148-
]
148+
]
File renamed without changes.
File renamed without changes.

conf/svg/badges.json readmeai/conf/svg/badges.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16927,4 +16927,4 @@
1692716927
"svg": "M14.135 6.818v1.715h-1.217V9.92h1.217v2.601c0 1.624.943 2.487 2.355 2.487.236 0 .562-.025.785-.076v-1.348c-.146.039-.312.05-.47.05-.708 0-1.205-.328-1.205-1.138V9.92h1.675V8.533h-1.671V6.818ZM20.873 8.4c-1.846 0-3.299 1.441-3.299 3.3 0 1.909 1.454 3.36 3.324 3.36 1.572 0 2.788-.89 3.024-2.238h-1.467c-.132.553-.746.918-1.531.918-1.034 0-1.688-.589-1.871-1.531h4.908c.026-.12.039-.445.039-.617 0-1.87-1.399-3.192-3.127-3.192ZM0 8.533v1.399h3.928L0 13.532v1.4h5.719v-1.4h-3.94l3.94-3.6V8.533Zm6.037 0 2.54 6.059-1.151 2.59h1.57l3.611-8.649h-1.57l-1.715 4.358-1.717-4.358Zm14.758 1.19c.875 0 1.49.511 1.623 1.244h-3.324c.21-.786.838-1.244 1.7-1.244z"
1692816928
}
1692916929
]
16930-
}
16930+
}

conf/svg/badges_compressed.json readmeai/conf/svg/badges_compressed.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9655,4 +9655,4 @@
96559655
"https://img.shields.io/badge/Zyte-B02CCE.svg?style&logo=Zyte&logoColor=white",
96569656
"B02CCE"
96579657
]
9658-
}
9658+
}

scripts/build_pypi.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
bash scripts/clean.sh
6+
7+
python -m build
8+
9+
twine upload --verbose --repository-url https://upload.pypi.org/legacy/ -u __token__ -p $PYPI_API_KEY dist/*
10+
11+
echo "Successfully pushed new readmeai package to PyPI!"

0 commit comments

Comments
 (0)