Skip to content

Commit 9e8125c

Browse files
committed
migrate to uv
1 parent 6725dce commit 9e8125c

File tree

2 files changed

+76
-88
lines changed

2 files changed

+76
-88
lines changed

codeflash/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# These version placeholders will be replaced by poetry-dynamic-versioning during `poetry build`.
1+
# These version placeholders will be replaced by hatch-vcs during build.
22
__version__ = "0.10.3"
33
__version_tuple__ = (0, 10, 3)

pyproject.toml

Lines changed: 75 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
[tool]
2-
[tool.poetry]
1+
[project]
32
name = "codeflash"
4-
version = "0.0.0" # Determined by poetry-dynamic-versioning during `poetry build`
53
description = "Client for codeflash.ai - automatic code performance optimization, powered by AI"
6-
license = "BSL-1.1"
7-
authors = ["CodeFlash Inc. <[email protected]>"]
8-
homepage = "https://codeflash.ai"
4+
authors = [{ name = "CodeFlash Inc.", email = "[email protected]" }]
5+
requires-python = ">=3.9"
96
readme = "README.md"
10-
packages = [{ include = "codeflash", format = ["sdist"] }]
7+
license = "BUSL-1.1 "
118
keywords = [
129
"codeflash",
1310
"performance",
@@ -17,6 +14,68 @@ keywords = [
1714
"machine learning",
1815
"LLM",
1916
]
17+
dependencies = [
18+
"unidiff>=0.7.4",
19+
"pytest>=7.0.0,<8.3.4",
20+
"gitpython>=3.1.31",
21+
"libcst>=1.0.1",
22+
"jedi>=0.19.1",
23+
"tiktoken>=0.3.2",
24+
"timeout-decorator>=0.5.0",
25+
"pytest-timeout>=2.1.0",
26+
"tomlkit>=0.11.7",
27+
"unittest-xml-reporting>=3.2.0",
28+
"junitparser>=3.1.0",
29+
"pydantic>=1.10.1",
30+
"humanize>=4.0.0",
31+
"posthog>=3.0.0,<=3.11.0",
32+
"click>=8.1.0",
33+
"inquirer>=3.0.0",
34+
"sentry-sdk>=1.40.6,<3.0.0",
35+
"parameterized>=0.9.0",
36+
"isort>=5.11.0",
37+
"dill>=0.3.8",
38+
"rich>=13.8.1",
39+
"lxml>=5.3.0",
40+
"crosshair-tool>=0.0.78",
41+
"coverage>=7.6.4",
42+
]
43+
44+
dynamic = ["version"] # Determined by uv-dynamic-versioning during `uv build`.
45+
46+
[project.urls]
47+
Homepage = "https://codeflash.ai"
48+
49+
[project.scripts]
50+
codeflash = "codeflash.main:main"
51+
52+
[dependency-groups]
53+
dev = [
54+
"ipython>=8.12.0",
55+
"mypy>=1.13",
56+
"ruff>=0.7.0",
57+
"lxml-stubs>=0.5.1",
58+
"pandas-stubs>=2.2.2.240807, <2.2.3.241009",
59+
"types-Pygments>=2.18.0.20240506",
60+
"types-colorama>=0.4.15.20240311",
61+
"types-decorator>=5.1.8.20240310",
62+
"types-jsonschema>=4.23.0.20240813",
63+
"types-requests>=2.32.0.20241016",
64+
"types-six>=1.16.21.20241009",
65+
"types-cffi>=1.16.0.20240331",
66+
"types-openpyxl>=3.1.5.20241020",
67+
"types-regex>=2024.9.11.20240912",
68+
"types-python-dateutil>=2.9.0.20241003",
69+
"pytest-cov>=6.0.0,<7",
70+
"types-gevent>=24.11.0.20241230,<25",
71+
"types-greenlet>=3.1.0.20241221,<4",
72+
"types-pexpect>=4.9.0.20241208,<5",
73+
"types-unidiff>=0.7.0.20240505,<0.8",
74+
"uv>=0.6.2",
75+
]
76+
77+
[tool.hatch.build]
78+
include = ["codeflash"]
2079
exclude = [
2180
"docs/*",
2281
"experiments/*",
@@ -65,68 +124,6 @@ exclude = [
65124
"env",
66125
]
67126

68-
# Versions here the minimum required versions for the project. These should be as loose as possible.
69-
[tool.poetry.dependencies]
70-
python = ">=3.9"
71-
unidiff = ">=0.7.4"
72-
pytest = ">=7.0.0,<8.3.4"
73-
gitpython = ">=3.1.31"
74-
libcst = ">=1.0.1"
75-
jedi = ">=0.19.1"
76-
tiktoken = ">=0.3.2"
77-
timeout-decorator = ">=0.5.0"
78-
pytest-timeout = ">=2.1.0"
79-
tomlkit = ">=0.11.7"
80-
unittest-xml-reporting = ">=3.2.0"
81-
junitparser = ">=3.1.0"
82-
pydantic = ">=1.10.1"
83-
humanize = ">=4.0.0"
84-
posthog = ">=3.0.0,<=3.11.0"
85-
click = ">=8.1.0"
86-
inquirer = ">=3.0.0"
87-
sentry-sdk = ">=1.40.6,<3.0.0"
88-
parameterized = ">=0.9.0"
89-
isort = ">=5.11.0"
90-
dill = ">=0.3.8"
91-
rich = ">=13.8.1"
92-
lxml = ">=5.3.0"
93-
crosshair-tool = ">=0.0.78"
94-
coverage = ">=7.6.4"
95-
[tool.poetry.group.dev]
96-
optional = true
97-
98-
# Don't forget to install the poetry plugins we use too:
99-
# poetry self add poetry-dynamic-versioning
100-
101-
[tool.poetry.group.dev.dependencies]
102-
ipython = ">=8.12.0"
103-
mypy = ">=1.13"
104-
ruff = ">=0.7.0"
105-
lxml-stubs = ">=0.5.1"
106-
pandas-stubs = ">=2.2.2.240807, <2.2.3.241009"
107-
types-Pygments = ">=2.18.0.20240506"
108-
types-colorama = ">=0.4.15.20240311"
109-
types-decorator = ">=5.1.8.20240310"
110-
types-jsonschema = ">=4.23.0.20240813"
111-
types-requests = ">=2.32.0.20241016"
112-
types-six = ">=1.16.21.20241009"
113-
types-cffi = ">=1.16.0.20240331"
114-
types-openpyxl = ">=3.1.5.20241020"
115-
types-regex = ">=2024.9.11.20240912"
116-
types-python-dateutil = ">=2.9.0.20241003"
117-
pytest-cov = "^6.0.0"
118-
types-gevent = "^24.11.0.20241230"
119-
types-greenlet = "^3.1.0.20241221"
120-
types-pexpect = "^4.9.0.20241208"
121-
types-unidiff = "^0.7.0.20240505"
122-
uv = ">=0.6.2"
123-
124-
[tool.poetry.build]
125-
script = "codeflash/update_license_version.py"
126-
127-
[tool.poetry.scripts]
128-
codeflash = "codeflash.main:main"
129-
130127
[tool.mypy]
131128
show_error_code_links = true
132129
pretty = true
@@ -198,22 +195,6 @@ split-on-trailing-comma = false
198195
docstring-code-format = true
199196
skip-magic-trailing-comma = true
200197

201-
[tool.poetry-dynamic-versioning]
202-
enable = true
203-
style = "pep440"
204-
vcs = "git"
205-
206-
[tool.poetry-dynamic-versioning.substitution]
207-
files = ["codeflash/version.py"]
208-
209-
[tool.poetry-dynamic-versioning.files."codeflash/version.py"]
210-
persistent-substitution = true
211-
initial-content = """
212-
# These version placeholders will be replaced by poetry-dynamic-versioning during `poetry build`.
213-
__version__ = "0.0.0"
214-
__version_tuple__ = (0, 0, 0)
215-
"""
216-
217198

218199
[tool.codeflash]
219200
module-root = "codeflash"
@@ -224,7 +205,14 @@ formatter-cmds = [
224205
"uvx ruff format $file",
225206
]
226207

208+
[tool.hatch.build.hooks.vcs]
209+
version-file = "codeflash/version.py"
210+
211+
[tool.hatch.version]
212+
source = "vcs"
213+
tag-pattern = "(?:^|^v|^release/)(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+)$"
214+
227215

228216
[build-system]
229-
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.2.0,<2.0.0"]
230-
build-backend = "poetry_dynamic_versioning.backend"
217+
requires = ["hatchling", "hatch-vcs"]
218+
build-backend = "hatchling.build"

0 commit comments

Comments
 (0)