Skip to content

Commit 5cb351a

Browse files
committed
general: switch to use pyproject.toml
1 parent db533f6 commit 5cb351a

File tree

4 files changed

+62
-58
lines changed

4 files changed

+62
-58
lines changed

.ci/release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def main() -> None:
4242
if dist.exists():
4343
shutil.rmtree(dist)
4444

45-
check_call('python3 setup.py sdist bdist_wheel', shell=True)
45+
check_call(['python3', '-m', 'build'])
4646

4747
TP = 'TWINE_PASSWORD'
4848
password = os.environ.get(TP)

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ jobs:
8080
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
8181
env:
8282
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
83-
run: pip3 install --user wheel twine && .ci/release --test
83+
run: pip3 install --user --upgrade build twine && .ci/release --test
8484

8585
- name: 'release to pypi'
8686
# always deploy tags to release pypi
8787
# NOTE: release tags are guarded by on: push: tags on the top
8888
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
8989
env:
9090
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
91-
run: pip3 install --user wheel twine && .ci/release
91+
run: pip3 install --user --upgrade build twine && .ci/release

pyproject.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[project]
2+
dynamic = ["version"] # version is managed by setuptools_scm
3+
name = "orgparse"
4+
description = "orgparse - Emacs org-mode parser in Python"
5+
license = {file = "LICENSE"}
6+
authors = [
7+
{name = "Takafumi Arakaki (@tkf)", email = "[email protected]"},
8+
{name = "Dmitrii Gerasimov (@karlicoss)", email = "[email protected]"},
9+
]
10+
maintainers = [
11+
{name = "Dmitrii Gerasimov (@karlicoss)", email = "[email protected]"},
12+
]
13+
keywords = ["org", "org-mode", "emacs"]
14+
# see: http://pypi.python.org/pypi?%3Aaction=list_classifiers
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"License :: OSI Approved :: BSD License",
18+
"Topic :: Text Processing :: Markup",
19+
]
20+
# TODO add it back later, perhaps via ast?
21+
# long_description=orgparse.__doc__,
22+
23+
[project.urls]
24+
Homepage = "https://github.com/karlicoss/orgparse"
25+
26+
[project.optional-dependencies]
27+
testing = [
28+
"pytest",
29+
]
30+
linting = [
31+
"pytest",
32+
"mypy",
33+
"lxml", # for mypy html coverage
34+
]
35+
36+
37+
[build-system]
38+
requires = ["setuptools", "setuptools-scm"]
39+
build-backend = "setuptools.build_meta"
40+
41+
[tool.setuptools_scm]
42+
version_scheme = "python-simplified-semver"
43+
local_scheme = "dirty-tag"
44+
45+
46+
# nice things about pyproject.toml
47+
# - zip_safe=False isn't neccessary anymore
48+
# - correctly discovers namespace packages by defuilt?
49+
# - correctly handles py.typed by default?
50+
# - handles src layout automatically https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#src-layout
51+
52+
# things I'm not sure about yet
53+
# - avoiding dupliation/variable reuse?
54+
# - file/git dependencies?
55+
# - unclear how to specify namespace package order https://github.com/seanbreckenridge/reorder_editable/issues/2
56+
57+
# TODO
58+
# - maybe it has a nicer pypi upload system? not sure
59+
# e.g. possibly use hatch/flit/pdb/poetry -- but not sure what's the benefit tbh

setup.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)