Skip to content

Commit

Permalink
general: switch to use pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Oct 2, 2023
1 parent db533f6 commit 5cb351a
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .ci/release
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main() -> None:
if dist.exists():
shutil.rmtree(dist)

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

TP = 'TWINE_PASSWORD'
password = os.environ.get(TP)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ jobs:
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: pip3 install --user wheel twine && .ci/release --test
run: pip3 install --user --upgrade build twine && .ci/release --test

- name: 'release to pypi'
# always deploy tags to release pypi
# NOTE: release tags are guarded by on: push: tags on the top
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: pip3 install --user wheel twine && .ci/release
run: pip3 install --user --upgrade build twine && .ci/release
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[project]
dynamic = ["version"] # version is managed by setuptools_scm
name = "orgparse"
description = "orgparse - Emacs org-mode parser in Python"
license = {file = "LICENSE"}
authors = [
{name = "Takafumi Arakaki (@tkf)", email = "[email protected]"},
{name = "Dmitrii Gerasimov (@karlicoss)", email = "[email protected]"},
]
maintainers = [
{name = "Dmitrii Gerasimov (@karlicoss)", email = "[email protected]"},
]
keywords = ["org", "org-mode", "emacs"]
# see: http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
"Topic :: Text Processing :: Markup",
]
# TODO add it back later, perhaps via ast?
# long_description=orgparse.__doc__,

[project.urls]
Homepage = "https://github.com/karlicoss/orgparse"

[project.optional-dependencies]
testing = [
"pytest",
]
linting = [
"pytest",
"mypy",
"lxml", # for mypy html coverage
]


[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "python-simplified-semver"
local_scheme = "dirty-tag"


# nice things about pyproject.toml
# - zip_safe=False isn't neccessary anymore
# - correctly discovers namespace packages by defuilt?
# - correctly handles py.typed by default?
# - handles src layout automatically https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#src-layout

# things I'm not sure about yet
# - avoiding dupliation/variable reuse?
# - file/git dependencies?
# - unclear how to specify namespace package order https://github.com/seanbreckenridge/reorder_editable/issues/2

# TODO
# - maybe it has a nicer pypi upload system? not sure
# e.g. possibly use hatch/flit/pdb/poetry -- but not sure what's the benefit tbh
55 changes: 0 additions & 55 deletions setup.py

This file was deleted.

0 comments on commit 5cb351a

Please sign in to comment.