diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5f5985f..973abab 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,15 +8,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip - cache-dependency-path: '**/setup.py' + cache-dependency-path: pyproject.toml - name: Run tests run: | python -m unittest @@ -26,11 +26,11 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.12' cache: pip - cache-dependency-path: '**/setup.py' + cache-dependency-path: pyproject.toml - name: Install dependencies run: | pip install setuptools wheel twine build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b4cc9a..d822feb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Run tests diff --git a/README.md b/README.md index fa608a1..f141fba 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,17 @@ into Things by Cultured Code ### On macOS -Install popthings using pip. Both Python 2 and Python 3 are supported. +Run popthings directly with [uv](https://docs.astral.sh/uv/), without installing +it first: ```bash -$ pip install popthings +uvx popthings template.taskpaper +``` + +Alternatively, install popthings using pip: + +```bash +pip install popthings ``` ### On iOS @@ -79,7 +86,7 @@ To import the template on the Mac, pass the TaskPaper filename to the their value. ```bash -$ popthings templatex-travel.taskpaper +uvx popthings templatex-travel.taskpaper Start value? 2018-09-01 Due value? 2018-09-10 Destination value? Paris @@ -114,7 +121,7 @@ are any. 1. Bump the version in `popthings.py` 2. Update the changelog, link the versions. 3. Commit and tag with version number. Push tags. Update the release on GitHub. -4. Build a source dist with `python3 setup.py clean && rm dist/* && python3 setup.py sdist bdist_wheel` +4. Build the source and wheel distributions with `uv build` 5. Test upload to PyPI test with `twine upload --repository-url https://test.pypi.org/legacy/ dist/*` 6. Create a temporary environment `mktmpenv` and test install with `pip install --index-url https://test.pypi.org/simple/ popthings` -7. If everything looks good, upload for real with `twine upload dist/*` \ No newline at end of file +7. If everything looks good, upload for real with `twine upload dist/*` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..29bc9ea --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "popthings" +dynamic = ["version"] +description = "Import TaskPaper templates with placeholders into Things" +readme = "README.md" +requires-python = ">=3.12" +license = "MIT" +license-files = ["LICENSE"] +authors = [ + { name = "Alexandre Chabot-Leclerc", email = "github@alexchabot.net" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Natural Language :: English", + "Operating System :: MacOS :: MacOS X", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] + +[project.scripts] +popthings = "popthings:cli" + +[project.urls] +Homepage = "https://github.com/achabotl/popthings" + +[tool.setuptools] +py-modules = ["popthings"] + +[tool.setuptools.dynamic] +version = { attr = "popthings.__version__" } diff --git a/setup.py b/setup.py deleted file mode 100644 index b192fe6..0000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -import io -import popthings -from setuptools import setup - - -with io.open("README.md", "r", encoding="utf-8") as f: - long_description = f.read() - - -setup( - name="popthings", - version=popthings.__version__, - author="Alexandre Chabot-Leclerc", - author_email="github@alexchabot.net", - description=( - "iOS and command line tool to import a TaskPaper template" - " with placeholders into Things by Cultured Code" - ), - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/achabotl/popthings", - scripts=["popthings.py"], - entry_points={ - "console_scripts": [ - "popthings = popthings:cli", - ], - }, - classifiers=( - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: iOS", - "Operating System :: MacOS :: MacOS X", - "Natural Language :: English", - ), -) diff --git a/tests/header_with_note.taskpaper b/tests/header_with_note.taskpaper new file mode 100644 index 0000000..b8049a2 --- /dev/null +++ b/tests/header_with_note.taskpaper @@ -0,0 +1,7 @@ +Project name: + Note under project + Header: + Note under header + - Task + Header 2: + Note under header 2 diff --git a/tests/just_tasks.taskpaper b/tests/just_tasks.taskpaper new file mode 100644 index 0000000..6de1c36 --- /dev/null +++ b/tests/just_tasks.taskpaper @@ -0,0 +1,2 @@ +- task 1 +- task 2 \ No newline at end of file diff --git a/tests/just_tasks_.taskpaper b/tests/just_tasks_.taskpaper new file mode 100644 index 0000000..0c266f5 --- /dev/null +++ b/tests/just_tasks_.taskpaper @@ -0,0 +1,15 @@ +Project 1: + $due $start $location + Note under project 1 + - Task 1 @due($start + 1w) + A note under task 1 + - Task 2 @start($start) + - Checklist item under task 2 + - A checklist under a checklist + Heading 1, to $location: + - Task under heading 1 + +Project 2: + - Task under project 2 + Heading 2, under project 2: + - Task under heading 2 diff --git a/tests/small.taskpaper b/tests/small.taskpaper new file mode 100644 index 0000000..0ab98ab --- /dev/null +++ b/tests/small.taskpaper @@ -0,0 +1,5 @@ +Project: + Note two levels in + - Task + - checklist item + Note diff --git a/tests/text.taskpaper b/tests/text.taskpaper new file mode 100644 index 0000000..78bc4cf --- /dev/null +++ b/tests/text.taskpaper @@ -0,0 +1,20 @@ +Project name: @start($start) @email + $start $due + Comment under project + More comments under project + - Task 0.1 @due($due) @email + Note 0.1 + Note 0.1 has two lines of comment + - Task 0.12 @start($start) + Heading 1: + Note 1. Where should it go? + - Task 1.1 + Note 1.1 + - Task 1.2 + HEading 2: + - Task 2.1 + Note 2.1 + - Checklist Item 2.1.1 + Note 2.1.1 +Project 2: + - Task under project 2 diff --git a/tests/with_empty_line.taskpaper b/tests/with_empty_line.taskpaper new file mode 100644 index 0000000..4099046 --- /dev/null +++ b/tests/with_empty_line.taskpaper @@ -0,0 +1,5 @@ +Project name: + - Task 1 + + - Task 2 +