Skip to main content

initial commit with code

ID
cfd9330
date
2025-11-28 21:07:07+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
521928e
message
initial commit with code
changed files
12 files, 314 additions

Changed files

.github/dependabot.yml (0) → .github/dependabot.yml (277)

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..68d4463
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,14 @@
+version: 2
+updates:
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: weekly
+      day: monday
+      time: "09:00"
+  - package-ecosystem: "pip"
+    directory: "/"
+    schedule:
+      interval: weekly
+      day: monday
+      time: "09:00"

.github/workflows/test.yml (0) → .github/workflows/test.yml (777)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..a6bbaef
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,45 @@
+name: Test
+
+on:
+  push:
+    branches:
+    - main
+
+  pull_request:
+    branches:
+    - main
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ["3.13", "3.14"]
+    
+    steps:
+    - uses: actions/checkout@v6
+
+    - name: Set up Python
+      uses: actions/setup-python@v6
+      with:
+        python-version: ${{ matrix.python-version }}
+        cache: pip
+
+    - name: Install dependencies
+      run: pip install -r dev_requirements.txt
+
+    - name: Check formatting
+      run: |
+        ruff check .
+        ruff format --check .
+
+    - name: Check docstrings
+      run: interrogate -vv
+
+    - name: Check types
+      run: mypy src tests
+
+    - name: Run tests
+      run: |
+        coverage run -m pytest tests
+        coverage report

.gitignore (0) → .gitignore (32)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..53713f0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.egg-info
+*.pyc
+.coverage
+dist

CHANGELOG.md (0) → CHANGELOG.md (89)

diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..c1d71ba
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,5 @@
+# CHANGELOG
+
+## v1 - 2025-11-28
+
+Initial release on PyPI, to test the release mechanism.

CONTRIBUTING.md (0) → CONTRIBUTING.md (1234)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..6546011
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,54 @@
+# CONTRIBUTING
+
+You can set up a local development environment by cloning the repo and installing dependencies:
+
+```shell
+git clone https://github.com/alexwlchan/chives.git
+cd chives
+python3 -m venv .venv
+source .venv/bin/activate
+pip install -e .
+```
+
+If you want to run tests, install the dev dependencies and run the tests:
+
+```shell
+# Activate the virtualenv and install dev dependencies
+source .venv/bin/activate
+pip install -r dev_requirements.txt
+
+# Check formatting
+ruff check .
+ruff format --check .
+
+# Check docstrings
+interrogate -vv
+
+# Check types
+mypy src tests
+
+# Run tests
+coverage run -m pytest tests
+coverage report
+```
+
+To make changes:
+
+1.  Create a new branch
+2.  Push your changes to GitHub
+3.  Open a pull request
+4.  Fix any issues flagged by GitHub Actions (including tests, code linting, and type checking)
+6.  Merge it!
+
+To create a new version on PyPI:
+
+1.  Update the version in `src/chives/__init__.py`
+2.  Add release notes in `CHANGELOG.md` and push a new tag to GitHub
+3.  Deploy the release using twine:
+
+    ```console
+    $ python3 -m build
+    $ python3 -m twine upload dist/* --username=__token__
+    ```
+
+    You will need [a PyPI API token](https://pypi.org/help/#apitoken) to publish packages.

LICENSE (0) → LICENSE (1053)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..b3d4b83
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2024 Alex Chan
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

dev_requirements.in (0) → dev_requirements.in (42)

diff --git a/dev_requirements.in b/dev_requirements.in
new file mode 100644
index 0000000..803a638
--- /dev/null
+++ b/dev_requirements.in
@@ -0,0 +1,7 @@
+-e file
+
+build
+mypy
+pytest-cov
+ruff
+twine

dev_requirements.txt (0) → dev_requirements.txt (1710)

diff --git a/dev_requirements.txt b/dev_requirements.txt
new file mode 100644
index 0000000..56279a8
--- /dev/null
+++ b/dev_requirements.txt
@@ -0,0 +1,89 @@
+# This file was autogenerated by uv via the following command:
+#    uv pip compile dev_requirements.in --output-file dev_requirements.txt
+-e file:.
+    # via -r dev_requirements.in
+build==1.3.0
+    # via -r dev_requirements.in
+certifi==2025.11.12
+    # via requests
+charset-normalizer==3.4.4
+    # via requests
+coverage==7.12.0
+    # via pytest-cov
+docutils==0.22.3
+    # via readme-renderer
+id==1.5.0
+    # via twine
+idna==3.11
+    # via requests
+iniconfig==2.3.0
+    # via pytest
+jaraco-classes==3.4.0
+    # via keyring
+jaraco-context==6.0.1
+    # via keyring
+jaraco-functools==4.3.0
+    # via keyring
+keyring==25.7.0
+    # via twine
+librt==0.6.2
+    # via mypy
+markdown-it-py==4.0.0
+    # via rich
+mdurl==0.1.2
+    # via markdown-it-py
+more-itertools==10.8.0
+    # via
+    #   jaraco-classes
+    #   jaraco-functools
+mypy==1.19.0
+    # via -r dev_requirements.in
+mypy-extensions==1.1.0
+    # via mypy
+nh3==0.3.2
+    # via readme-renderer
+packaging==25.0
+    # via
+    #   build
+    #   pytest
+    #   twine
+pathspec==0.12.1
+    # via mypy
+pluggy==1.6.0
+    # via
+    #   pytest
+    #   pytest-cov
+pygments==2.19.2
+    # via
+    #   pytest
+    #   readme-renderer
+    #   rich
+pyproject-hooks==1.2.0
+    # via build
+pytest==9.0.1
+    # via pytest-cov
+pytest-cov==7.0.0
+    # via -r dev_requirements.in
+readme-renderer==44.0
+    # via twine
+requests==2.32.5
+    # via
+    #   id
+    #   requests-toolbelt
+    #   twine
+requests-toolbelt==1.0.0
+    # via twine
+rfc3986==2.0.0
+    # via twine
+rich==14.2.0
+    # via twine
+ruff==0.14.7
+    # via -r dev_requirements.in
+twine==6.2.0
+    # via -r dev_requirements.in
+typing-extensions==4.15.0
+    # via mypy
+urllib3==2.5.0
+    # via
+    #   requests
+    #   twine

pyproject.toml (0) → pyproject.toml (1194)

diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..6204fa6
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,57 @@
+[build-system]
+requires = [
+    "setuptools >= 65",
+]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "chives"
+description = "Utility functions for working with my local media archives"
+readme = "README.md"
+authors = [
+  {name = "Alex Chan", email = "alex@alexwlchan.net"},
+]
+maintainers = [
+  {name = "Alex Chan", email="alex@alexwlchan.net"},
+]
+classifiers = [
+  "Development Status :: 5 - Production/Stable",
+  "Programming Language :: Python :: 3.13",
+]
+requires-python = ">=3.13"
+dependencies = []
+dynamic = ["version"]
+license = "MIT"
+
+[project.urls]
+"Homepage" = "https://github.com/alexwlchan/chives"
+"Changelog" = "https://github.com/alexwlchan/chives/blob/main/CHANGELOG.md"
+
+[tool.setuptools.dynamic]
+version = {attr = "chives.__version__"}
+
+[tool.setuptools.packages.find]
+where = ["src"]
+
+[tool.setuptools.package-data]
+nitrate = ["py.typed"]
+
+[tool.coverage.run]
+branch = true
+source = ["chives", "tests",]
+
+[tool.coverage.report]
+show_missing = true
+skip_covered = true
+fail_under = 100
+
+[tool.pytest.ini_options]
+filterwarnings = ["error"]
+
+[tool.mypy]
+mypy_path = "src"
+strict = true
+
+[tool.ruff.lint]
+select = ["D"]
+ignore = ["D200", "D203", "D204", "D205", "D212"]

src/chives/__init__.py (0) → src/chives/__init__.py (390)

diff --git a/src/chives/__init__.py b/src/chives/__init__.py
new file mode 100644
index 0000000..cec1174
--- /dev/null
+++ b/src/chives/__init__.py
@@ -0,0 +1,14 @@
+"""
+chives is a collection of Python functions for working with my local
+media archives.
+
+I store a lot of media archives as static websites [1][2], and I use
+Python scripts to manage my media. This package has some functions
+I share across multiple sites.
+
+[1]: https://alexwlchan.net/2024/static-websites/
+[2]: https://alexwlchan.net/2025/mildly-dynamic-websites/
+
+"""
+
+__version__ = "0"

src/chives/py.typed (0) → src/chives/py.typed (0)

diff --git a/src/chives/py.typed b/src/chives/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/chives/py.typed

tests/test_truth.py (0) → tests/test_truth.py (107)

diff --git a/tests/test_truth.py b/tests/test_truth.py
new file mode 100644
index 0000000..2c10529
--- /dev/null
+++ b/tests/test_truth.py
@@ -0,0 +1,6 @@
+"""Tests for `chives`."""
+
+
+def test_truth() -> None:
+    """Basic test to exercise CI."""
+    assert True