codeflash/pyproject.toml

225 lines
4.8 KiB
TOML
Raw Normal View History

[tool]
[tool.poetry]
name = "codeflash"
version = "0.0.0" # Determined by poetry-dynamic-versioning during `poetry build`
description = "Client for codeflash.ai - automatic code performance optimization, powered by AI"
license = "BSL-1.1"
2024-01-13 01:26:51 +00:00
authors = ["CodeFlash Inc. <contact@codeflash.ai>"]
homepage = "https://codeflash.ai"
readme = "README.md"
packages = [{ include = "codeflash", format = ["sdist"] }]
2024-11-06 00:43:02 +00:00
keywords = [
"codeflash",
"performance",
"optimization",
"ai",
"code",
"machine learning",
"LLM",
]
add exclude sensitive files from package build (#1190) ### **User description** Adding files to be excluded while building pypi project or avoiding sensitive files like .env from check in ___ ### **PR Type** enhancement, configuration changes ___ ### **Description** - Added exclusion rules in `pyproject.toml` files to prevent sensitive and unnecessary files from being included in the package build. - Excluded files include sensitive files like `.env` and `.pem`, development files like `.git` and `Dockerfile`, and unnecessary file types like `*.log` and `*.db`. - This enhancement improves the security and cleanliness of the package distribution. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>pyproject.toml</strong><dd><code>Add exclusion rules for sensitive and unnecessary files</code>&nbsp; &nbsp; </dd></summary> <hr> cli/pyproject.toml <li>Added an <code>exclude</code> section to specify files and directories to be <br>excluded from the package build.<br> <li> Included patterns for sensitive files like <code>.env</code>, <code>.pem</code>, and <code>secrets.*</code>.<br> <li> Excluded common development and configuration files such as <code>.git</code>, <br><code>Dockerfile</code>, and <code>.vscode</code>.<br> <li> Excluded unnecessary file types like <code>*.log</code>, <code>*.tmp</code>, and <code>*.db</code>.<br> </details> </td> <td><a href="https://github.com/codeflash-ai/codeflash/pull/1190/files#diff-0c21298b23605dcadf25950579e3ada906093fa49e7c5f98eaa7f3d816c29d28">+47/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>pyproject.toml</strong><dd><code>Add exclusion rules for sensitive and unnecessary files</code>&nbsp; &nbsp; </dd></summary> <hr> django/aiservice/pyproject.toml <li>Added an <code>exclude</code> section to specify files and directories to be <br>excluded from the package build.<br> <li> Included patterns for sensitive files like <code>.env</code>, <code>.pem</code>, and <code>secrets.*</code>.<br> <li> Excluded common development and configuration files such as <code>.git</code>, <br><code>Dockerfile</code>, and <code>.vscode</code>.<br> <li> Excluded unnecessary file types like <code>*.log</code>, <code>*.tmp</code>, and <code>*.db</code>.<br> </details> </td> <td><a href="https://github.com/codeflash-ai/codeflash/pull/1190/files#diff-1cd1f75beb8e70c006a688caffdd71f14a3babb13cc499ca48f499bd530fca1e">+45/-1</a>&nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
2024-11-06 20:44:55 +00:00
exclude = [
"docs/*",
"experiments/*",
"tests/*",
"*.pyc",
"__pycache__",
"*.pyo",
"*.pyd",
"*.so",
"*.dylib",
"*.dll",
"*.exe",
"*.log",
"*.tmp",
".env",
".env.*",
"**/.env",
"**/.env.*",
".env.example",
"*.pem",
"*.key",
"secrets.*",
"config.yaml",
"config.json",
".git",
".gitignore",
".gitattributes",
".github",
"Dockerfile",
"docker-compose.yml",
"*.md",
"*.txt",
"*.csv",
"*.db",
"*.sqlite3",
"*.pdf",
"*.docx",
"*.xlsx",
"*.pptx",
"*.iml",
".idea",
".vscode",
".DS_Store",
"Thumbs.db",
"venv",
"env",
]
# Versions here the minimum required versions for the project. These should be as loose as possible.
[tool.poetry.dependencies]
2024-11-25 05:13:25 +00:00
python = "^3.9"
2024-01-31 03:29:36 +00:00
unidiff = ">=0.7.4"
pytest = ">=7.0.0"
gitpython = ">=3.1.31"
libcst = ">=1.0.1"
jedi = ">=0.19.1"
2024-01-31 04:35:57 +00:00
tiktoken = ">=0.3.2"
2024-01-31 03:29:36 +00:00
timeout-decorator = ">=0.5.0"
pytest-timeout = ">=2.1.0"
tomlkit = ">=0.11.7"
unittest-xml-reporting = ">=3.2.0"
junitparser = ">=3.1.0"
pydantic = ">=1.10.1"
2024-01-31 19:33:31 +00:00
humanize = ">=4.0.0"
2025-02-11 02:37:03 +00:00
posthog = ">=3.0.0,<=3.11.0"
click = ">=8.1.0"
2024-01-31 19:33:31 +00:00
inquirer = ">=3.0.0"
sentry-sdk = ">=1.40.6,<3.0.0"
2024-02-23 18:29:17 +00:00
parameterized = ">=0.9.0"
2024-04-18 02:07:22 +00:00
isort = ">=5.11.0"
2024-11-25 03:08:34 +00:00
dill = ">=0.3.8"
rich = ">=13.8.1"
lxml = ">=5.3.0"
2024-11-15 00:52:55 +00:00
crosshair-tool = ">=0.0.78"
2024-11-07 17:30:34 +00:00
coverage = ">=7.6.4"
[tool.poetry.group.dev]
optional = true
2024-10-25 23:00:14 +00:00
# Don't forget to install the poetry plugins we use too:
# poetry self add poetry-dynamic-versioning
[tool.poetry.group.dev.dependencies]
2024-11-25 03:08:34 +00:00
ipython = ">=8.12.0"
mypy = ">=1.13"
ruff = ">=0.7.0"
2024-11-25 03:08:34 +00:00
lxml-stubs = ">=0.5.1"
pandas-stubs = ">=2.2.2.240807, <2.2.3.241009"
2024-11-25 03:08:34 +00:00
types-Pygments = ">=2.18.0.20240506"
types-colorama = ">=0.4.15.20240311"
types-decorator = ">=5.1.8.20240310"
types-jsonschema = ">=4.23.0.20240813"
types-requests = ">=2.32.0.20241016"
types-six = ">=1.16.21.20241009"
types-cffi = ">=1.16.0.20240331"
types-openpyxl = ">=3.1.5.20241020"
types-regex = ">=2024.9.11.20240912"
types-python-dateutil = ">=2.9.0.20241003"
2024-12-09 20:17:16 +00:00
pytest-cov = "^6.0.0"
2025-02-05 10:09:46 +00:00
types-gevent = "^24.11.0.20241230"
types-greenlet = "^3.1.0.20241221"
types-pexpect = "^4.9.0.20241208"
types-unidiff = "^0.7.0.20240505"
[tool.poetry.build]
script = "codeflash/update_license_version.py"
[tool.poetry.scripts]
codeflash = "codeflash.main:main"
[tool.mypy]
2024-10-23 21:51:27 +00:00
show_error_code_links = true
2024-03-06 06:56:10 +00:00
pretty = true
show_absolute_path = true
show_error_context = true
2024-10-23 21:51:27 +00:00
show_error_end = true
2024-03-06 06:56:10 +00:00
strict = true
warn_unreachable = true
2024-10-23 21:51:27 +00:00
install_types = true
2024-12-16 23:33:48 +00:00
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
2025-01-18 01:44:24 +00:00
module = ["jedi", "jedi.api.classes", "inquirer", "inquirer.themes", "numba"]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
2024-10-23 21:51:27 +00:00
[tool.ruff]
line-length = 120
fix = true
show-fixes = true
2024-11-06 00:43:02 +00:00
exclude = ["code_to_optimize/", "pie_test_set/"]
2024-10-23 21:51:27 +00:00
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"C901",
"D100",
"D101",
"D102",
"D103",
"D105",
"D107",
"S101",
"S603",
"S607",
"ANN101",
"COM812",
"FIX002",
"PLR0912",
"PLR0913",
"PLR0915",
"TD002",
"TD003",
"TD004",
"PLR2004"
]
[tool.ruff.lint.flake8-type-checking]
strict = true
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
runtime-evaluated-decorators = ["pydantic.validate_call"]
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
"pydantic.validator",
]
[tool.ruff.format]
docstring-code-format = true
2024-10-23 21:51:27 +00:00
skip-magic-trailing-comma = true
[tool.poetry-dynamic-versioning]
enable = true
style = "pep440"
vcs = "git"
[tool.poetry-dynamic-versioning.substitution]
files = ["codeflash/version.py"]
[tool.poetry-dynamic-versioning.files."codeflash/version.py"]
persistent-substitution = true
initial-content = """
# These version placeholders will be replaced by poetry-dynamic-versioning during `poetry build`.
__version__ = "0.0.0"
__version_tuple__ = (0, 0, 0)
"""
[tool.codeflash]
2024-01-25 20:28:16 +00:00
module-root = "codeflash"
tests-root = "tests"
test-framework = "pytest"
2024-11-06 00:43:02 +00:00
formatter-cmds = [
"poetry run ruff check --exit-zero --fix $file",
"poetry run ruff format $file",
]
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.2.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"