Skip to content

Commit b981e01

Browse files
committed
Use setuptools-scm
1 parent ba396ab commit b981e01

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

LICENSE

Whitespace-only changes.

pyproject.toml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[build-system]
2-
requires = ["setuptools>=61.0", "wheel"]
2+
requires = ["setuptools>=61.0", "wheel", "setuptools_scm[toml]>=6.2"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "cedarscript-ast-parser"
77
dynamic = ["version"]
88
description = "A library for parsing and interpreting CEDARScript, a SQL-like language for code analysis and transformations"
9-
readme = "README.md"
109
authors = [{ name = "Elifarley", email = "cedarscript@orgecc.com" }]
11-
license = { file = "LICENSE" }
10+
readme = "README.md"
11+
license = {text = "MIT"}
1212
classifiers = [
1313
"Programming Language :: Python :: 3",
1414
"Programming Language :: Python :: 3.12",
@@ -22,7 +22,7 @@ classifiers = [
2222
]
2323
keywords = ["parser", "ast", "cedarscript", "code-editing", "refactoring", "code-analysis", "sql-like", "ai-assisted-development"]
2424
dependencies = [
25-
"cedarscript-grammar>=0.0.9",
25+
"cedarscript-grammar>=0.0.10",
2626
]
2727
requires-python = ">=3.8"
2828

@@ -40,15 +40,34 @@ dev = [
4040
"flake8>=4.0",
4141
]
4242

43-
[tool.setuptools.dynamic]
44-
version = {attr = "cedarscript_ast_parser.__version__"}
45-
4643
[tool.setuptools]
4744
package-dir = {"" = "src"}
48-
py-modules = ["cedarscript_ast_parser"]
45+
46+
[tool.setuptools_scm]
47+
# To override version:
48+
# >>> SETUPTOOLS_SCM_PRETEND_VERSION=0.0.2 python -m build
49+
# To dry-run and see version:
50+
# >>> python -m setuptools_scm
51+
write_to = "src/cedarscript_ast_parser/_version.py"
52+
# Append .post{number of commits} to your version if there are commits after the last tag.
53+
version_scheme = "post-release"
4954

5055
[tool.setuptools.packages.find]
5156
where = ["src"]
5257
include = ["cedarscript_ast_parser*"]
5358
exclude = ["cedarscript_ast_parser.tests*"]
5459
namespaces = false
60+
61+
[tool.black]
62+
line-length = 100
63+
target-version = ['py39']
64+
65+
[tool.isort]
66+
profile = "black"
67+
line_length = 100
68+
69+
[tool.mypy]
70+
python_version = "3.8"
71+
strict = true
72+
warn_return_any = true
73+
warn_unused_configs = true

src/cedarscript_ast_parser/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.2.2"
1+
from ._version import __version__
22

33
from .cedarscript_ast_parser import (
44
CEDARScriptASTParser, ParseError, Command,
@@ -9,6 +9,7 @@
99
)
1010

1111
__all__ = (
12+
__version__,
1213
CEDARScriptASTParser, ParseError, Command,
1314
CreateCommand, RmFileCommand, MvFileCommand, UpdateCommand,
1415
SelectCommand, IdentifierFromFile, SingleFileClause, Segment, Marker, BodyOrWhole, MarkerType, RelativeMarker,

0 commit comments

Comments
 (0)