Skip to main content

Initial commit

ID
95da871
date
2024-08-16 21:03:52+00:00
author
Alex Chan <alex@alexwlchan.net>
message
Initial commit
changed files
10 files, 234 additions

Changed files

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

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..9452b32
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,12 @@
+version: 2
+updates:
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "daily"
+      time: "09:00"
+  - package-ecosystem: "pip"
+    directory: "/"
+    schedule:
+      interval: "daily"
+      time: "09:00"

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

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..754e0a6
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,37 @@
+name: Test
+
+on:
+  push:
+    branches:
+    - main
+
+  pull_request:
+    branches:
+    - main
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v4
+
+    - name: Set up Python
+      uses: actions/setup-python@v5
+      with:
+        python-version: 3.12
+        cache: pip
+
+    - name: Install dependencies
+      run: pip install -r dev_requirements.txt
+
+    - name: Run linting
+      run: |
+        ruff check .
+        ruff format --check .
+
+    - 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

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.

README.md (0) → README.md (324)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c51d079
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+# python-js-files
+
+This is a small collection of Python functions for manipulating JavaScript "data files" -- that is, JavaScript files that have a single variable that defines a JSON value.
+For example:
+
+```javascript
+const shape = { "sides": 5, "colour": "red" };
+```
+
+## API
+
+## Why not use JSON files?
+
+## License
+
+MIT.

dev_requirements.in (0) → dev_requirements.in (44)

diff --git a/dev_requirements.in b/dev_requirements.in
new file mode 100644
index 0000000..4198c39
--- /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 (1669)

diff --git a/dev_requirements.txt b/dev_requirements.txt
new file mode 100644
index 0000000..4e2a18c
--- /dev/null
+++ b/dev_requirements.txt
@@ -0,0 +1,84 @@
+# 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.2.1
+    # via -r dev_requirements.in
+certifi==2024.7.4
+    # via requests
+charset-normalizer==3.3.2
+    # via requests
+coverage==7.6.1
+    # via pytest-cov
+docutils==0.21.2
+    # via readme-renderer
+idna==3.7
+    # via requests
+importlib-metadata==8.2.0
+    # via twine
+iniconfig==2.0.0
+    # via pytest
+jaraco-classes==3.4.0
+    # via keyring
+jaraco-context==5.3.0
+    # via keyring
+jaraco-functools==4.0.2
+    # via keyring
+keyring==25.3.0
+    # via twine
+markdown-it-py==3.0.0
+    # via rich
+mdurl==0.1.2
+    # via markdown-it-py
+more-itertools==10.4.0
+    # via
+    #   jaraco-classes
+    #   jaraco-functools
+mypy==1.11.1
+    # via -r dev_requirements.in
+mypy-extensions==1.0.0
+    # via mypy
+nh3==0.2.18
+    # via readme-renderer
+packaging==24.1
+    # via
+    #   build
+    #   pytest
+pkginfo==1.10.0
+    # via twine
+pluggy==1.5.0
+    # via pytest
+pygments==2.18.0
+    # via
+    #   readme-renderer
+    #   rich
+pyproject-hooks==1.1.0
+    # via build
+pytest==8.3.2
+    # via pytest-cov
+pytest-cov==5.0.0
+    # via -r dev_requirements.in
+readme-renderer==44.0
+    # via twine
+requests==2.32.3
+    # via
+    #   requests-toolbelt
+    #   twine
+requests-toolbelt==1.0.0
+    # via twine
+rfc3986==2.0.0
+    # via twine
+rich==13.7.1
+    # via twine
+ruff==0.6.1
+    # via -r dev_requirements.in
+twine==5.1.1
+    # via -r dev_requirements.in
+typing-extensions==4.12.2
+    # via mypy
+urllib3==2.2.2
+    # via
+    #   requests
+    #   twine
+zipp==3.20.0
+    # via importlib-metadata

pyproject.toml (0) → pyproject.toml (1193)

diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..c88084c
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,54 @@
+[build-system]
+requires = [
+    "setuptools >= 65",
+]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "alexwlchan-python-js-files"
+description = "Manipulate JavaScript data files from Python"
+readme = "README.md"
+keywords = ["flickr"]
+authors = [
+  {name = "Alex Chan", email = "alex@alexwlchan.net"},
+]
+maintainers = [
+  {name = "Alex Chan", email="alex@alexwlchan.net"},
+]
+classifiers = [
+  "Development Status :: 5 - Production/Stable",
+  "License :: OSI Approved :: MIT License",
+  "Programming Language :: Python :: 3.12",
+]
+requires-python = ">=3.12"
+dependencies = []
+dynamic = ["version"]
+
+[project.urls]
+"Homepage" = "https://github.com/alexwlchan/python-js-files"
+"Changelog" = "https://github.com/alexwlchan/python-js-files/blob/main/CHANGELOG.md"
+
+[tool.setuptools.dynamic]
+version = {attr = "javascript.__version__"}
+
+[tool.setuptools.packages.find]
+where = ["src"]
+
+[tool.setuptools.package-data]
+nitrate = ["py.typed"]
+
+[tool.coverage.run]
+branch = true
+source = ["javascript", "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

src/javascript/__init__.py (0) → src/javascript/__init__.py (22)

diff --git a/src/javascript/__init__.py b/src/javascript/__init__.py
new file mode 100644
index 0000000..0b2f79d
--- /dev/null
+++ b/src/javascript/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.1.3"

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

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