-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
131 lines (117 loc) · 5.55 KB
/
pyproject.toml
File metadata and controls
131 lines (117 loc) · 5.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
[project]
name = "unpythonic"
description = "Supercharge your Python with parts of Lisp and Haskell."
authors = [
{ name = "Juha Jeronen", email = "juha.m.jeronen@gmail.com" },
]
requires-python = ">=3.10,<3.15"
# the `read` function and long_description_content_type from setup.py are no longer needed,
# modern build tools like pdm/hatch already know how to handle markdown if you point them at a .md file
# they will set the long_description and long_description_content_type for you
readme = "README.md"
license = { text = "BSD" }
# This tells whichever build backend you use (pdm in our case) to run its own mechanism to find the version
# of the project and plug it into the metadata
# details for how we instruct pdm to find the version are in the `[tool.pdm.version]` section below
dynamic = ["version"]
dependencies = [
"mcpyrate>=4.0.0",
"sympy>=1.13"
]
keywords=["functional-programming", "language-extension", "syntactic-macros",
"tail-call-optimization", "tco", "continuations", "currying", "lazy-evaluation",
"dynamic-variable", "macros", "lisp", "scheme", "racket", "haskell"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules"
]
[project.urls]
Repository = "https://github.com/Technologicat/unpythonic"
[dependency-groups]
dev = [
"ruff>=0.14.0",
"flake8",
"autopep8",
"importmagic",
"epc",
"jedi>=0.19.2",
# For local pre-release sanity checks: `python -m build --sdist`
# exercises the same sdist path that CI runs on tag push.
"build",
# For validating .github/workflows/*.yml during local dev (not used at runtime).
"pyyaml>=6.0.3",
]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pdm.version]
# the `file` source tells pdm to look for a line in a file that matches the regex `__version__ = ".*"`
# The regex parse is fairly robust, it can handle arbitray whitespace and comments
source = "file"
path = "unpythonic/__init__.py"
[tool.pdm.build]
# we don't need to explicitly inclue `mcpyrate.repl`. Unlink with setuptools, pdm automatically includes
# all packages and modules in the source tree pointed to by `includes`, minus any paths matching `excludes`
includes = ["unpythonic"]
excludes = ["**/tests", "**/__pycache__"]
# note the exclusion of an equivalent to zip_safe. I used to think that zip_safe was a core python metadata flag
# telling pip and other python tools not to include the package in any kind of zip-import or zipapp file.
# I was wrong. zip_safe is a setuptools-specific flag that tells setuptools to not include the package in a bdist_egg
# Since bdist_eggs are no longer really used by anything and have been completely supplanted by wheels, zip_safe has no meaningful effect.
# The effect i think you hoped to achieve with zip_safe is achieved by excluding `__pycache__` folders from
# the built wheels, using the `excludes` field in the `[tool.pdm.build]` section above.
# most python tools at this point, including mypy, have support for sourcing configuration from pyproject.toml
# making the setup.cfg file unnecessary
[tool.ruff]
line-length = 130
target-version = "py314"
exclude = [
".git",
"__pycache__",
"build",
"dist",
".venv",
]
[tool.ruff.lint]
select = ["E", "W", "F", "SIM"]
ignore = [
# pycodestyle
"E203", # whitespace before ':' — needed for slice alignment
"E265", # block comment should start with '# ' — commented-out code, markers
"E301", # expected 1 blank line — blank lines are semantic paragraph breaks
"E302", # expected 2 blank lines before def — same
"E305", # expected 2 blank lines after end — same
"E306", # expected blank line before nested def — same
"E402", # module level import not at top — conditional/deferred imports
"E501", # line too long — advisory, not enforced
"E731", # lambda assignment — closures are idiomatic in this codebase
# flake8-simplify
"SIM102", # collapsible if — nested ifs often represent distinct semantic guards
"SIM105", # contextlib.suppress — try/except/pass is more flexible and explicit
"SIM108", # ternary instead of if/else — often less readable, no real gain
"SIM114", # combine if branches — match-casing style; autofix would damage semantics
"SIM117", # combine with statements — nesting shows parent/child; also mcpyrate AST differences
"SIM118", # in-dict-keys — explicit .keys() marks the variable as a dictlike
"SIM300", # yoda conditions — natural reading order preferred
"SIM910", # dict.get with None default — explicit None documents programmer intent
# Note: SIM103 (return condition directly) is intentionally NOT ignored here.
# It is enabled as an advisory — CI runs it in a non-failing second pass.
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"] # re-exports via star-import
[tool.mypy]
show_error_codes = true