printnode-community 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. printnode_community-0.3.0/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  2. printnode_community-0.3.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. printnode_community-0.3.0/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  4. printnode_community-0.3.0/.github/dependabot.yml +29 -0
  5. printnode_community-0.3.0/.github/pull_request_template.md +39 -0
  6. printnode_community-0.3.0/.github/workflows/ci.yml +75 -0
  7. printnode_community-0.3.0/.github/workflows/publish.yml +105 -0
  8. printnode_community-0.3.0/.gitignore +8 -0
  9. printnode_community-0.3.0/AGENTS.md +75 -0
  10. printnode_community-0.3.0/CHANGELOG.md +36 -0
  11. printnode_community-0.3.0/CONTRIBUTING.md +42 -0
  12. printnode_community-0.3.0/LICENSE +22 -0
  13. printnode_community-0.3.0/PKG-INFO +546 -0
  14. printnode_community-0.3.0/README.md +514 -0
  15. printnode_community-0.3.0/RELEASE.md +118 -0
  16. printnode_community-0.3.0/SECURITY.md +23 -0
  17. printnode_community-0.3.0/printnode_community/__init__.py +13 -0
  18. printnode_community-0.3.0/printnode_community/accounts.py +228 -0
  19. printnode_community-0.3.0/printnode_community/auth.py +224 -0
  20. printnode_community-0.3.0/printnode_community/computers.py +317 -0
  21. printnode_community-0.3.0/printnode_community/gateway.py +105 -0
  22. printnode_community-0.3.0/printnode_community/model.py +279 -0
  23. printnode_community-0.3.0/printnode_community/util.py +11 -0
  24. printnode_community-0.3.0/pyproject.toml +57 -0
  25. printnode_community-0.3.0/test +4 -0
  26. printnode_community-0.3.0/tests/README.md +19 -0
  27. printnode_community-0.3.0/tests/__init__.py +0 -0
  28. printnode_community-0.3.0/tests/test_accounts.py +170 -0
  29. printnode_community-0.3.0/tests/test_auth.py +293 -0
  30. printnode_community-0.3.0/tests/test_computers.py +227 -0
  31. printnode_community-0.3.0/tests/test_imports.py +15 -0
  32. printnode_community-0.3.0/tests/test_model.py +162 -0
  33. printnode_community-0.3.0/tests/test_util.py +9 -0
  34. printnode_community-0.3.0/uv.lock +730 -0
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a reproducible problem with the Python client
4
+ title: ""
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Summary
10
+
11
+
12
+ ## Environment
13
+
14
+ - Python version:
15
+ - Package version or commit:
16
+ - Operating system:
17
+
18
+ ## Steps to Reproduce
19
+
20
+ 1.
21
+ 2.
22
+ 3.
23
+
24
+ ## Expected Behavior
25
+
26
+
27
+ ## Actual Behavior
28
+
29
+
30
+ ## Additional Context
31
+
32
+ Do not include real PrintNode API keys, account credentials, or customer data.
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: PrintNode API Documentation
4
+ url: https://www.printnode.com/en/docs/api/curl
5
+ about: Reference documentation for the PrintNode API.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an improvement or missing PrintNode API capability
4
+ title: ""
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Summary
10
+
11
+
12
+ ## Use Case
13
+
14
+
15
+ ## Proposed Behavior
16
+
17
+
18
+ ## Compatibility Notes
19
+
20
+
21
+ ## Additional Context
22
+
23
+
@@ -0,0 +1,29 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "uv"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ day: "monday"
8
+ time: "09:00"
9
+ open-pull-requests-limit: 5
10
+ commit-message:
11
+ prefix: "deps"
12
+ groups:
13
+ python-dependencies:
14
+ patterns:
15
+ - "*"
16
+
17
+ - package-ecosystem: "github-actions"
18
+ directory: "/"
19
+ schedule:
20
+ interval: "weekly"
21
+ day: "monday"
22
+ time: "09:00"
23
+ open-pull-requests-limit: 5
24
+ commit-message:
25
+ prefix: "deps"
26
+ groups:
27
+ github-actions:
28
+ patterns:
29
+ - "*"
@@ -0,0 +1,39 @@
1
+ ## Summary
2
+
3
+ -
4
+
5
+ ## Type of Change
6
+
7
+ - [ ] Documentation or governance
8
+ - [ ] Tests only
9
+ - [ ] Bug fix
10
+ - [ ] Packaging or tooling
11
+ - [ ] CI or release workflow
12
+ - [ ] Breaking change
13
+
14
+ ## Verification
15
+
16
+ - [ ] I ran the relevant tests locally
17
+ - [ ] I updated or added tests where appropriate
18
+ - [ ] I updated documentation where appropriate
19
+ - [ ] CI is expected to pass
20
+
21
+ Commands run:
22
+
23
+ ```sh
24
+
25
+ ```
26
+
27
+ Commands not run, with reason:
28
+
29
+ ```text
30
+
31
+ ```
32
+
33
+ ## Compatibility Notes
34
+
35
+ -
36
+
37
+ ## Release Notes
38
+
39
+ -
@@ -0,0 +1,75 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ name: Test Python ${{ matrix.python-version }}
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ python-version:
24
+ - "3.10"
25
+ - "3.11"
26
+ - "3.12"
27
+ - "3.13"
28
+ - "3.14"
29
+
30
+ steps:
31
+ - name: Check out repository
32
+ uses: actions/checkout@v6
33
+
34
+ - name: Install uv
35
+ uses: astral-sh/setup-uv@v8.1.0
36
+ with:
37
+ enable-cache: true
38
+
39
+ - name: Set up Python ${{ matrix.python-version }}
40
+ uses: actions/setup-python@v6
41
+ with:
42
+ python-version: ${{ matrix.python-version }}
43
+
44
+ - name: Install dependencies
45
+ run: uv sync --locked --python ${{ matrix.python-version }}
46
+
47
+ - name: Run tests
48
+ run: uv run pytest
49
+
50
+ package:
51
+ name: Build package
52
+ runs-on: ubuntu-latest
53
+
54
+ steps:
55
+ - name: Check out repository
56
+ uses: actions/checkout@v6
57
+
58
+ - name: Install uv
59
+ uses: astral-sh/setup-uv@v8.1.0
60
+ with:
61
+ enable-cache: true
62
+
63
+ - name: Set up Python
64
+ uses: actions/setup-python@v6
65
+ with:
66
+ python-version: "3.14"
67
+
68
+ - name: Install dependencies
69
+ run: uv sync --locked --python 3.14
70
+
71
+ - name: Build artifacts
72
+ run: uv build
73
+
74
+ - name: Check artifact metadata
75
+ run: uv run twine check dist/*
@@ -0,0 +1,105 @@
1
+ name: Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ repository:
7
+ description: "Package repository to publish to"
8
+ required: true
9
+ default: "testpypi"
10
+ type: choice
11
+ options:
12
+ - testpypi
13
+ - pypi
14
+
15
+ permissions:
16
+ contents: read
17
+ id-token: write
18
+
19
+ concurrency:
20
+ group: ${{ github.workflow }}-${{ inputs.repository }}
21
+ cancel-in-progress: false
22
+
23
+ jobs:
24
+ build:
25
+ name: Build release artifacts
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ - name: Check out repository
30
+ uses: actions/checkout@v6
31
+
32
+ - name: Require release tag
33
+ run: |
34
+ if [ "${GITHUB_REF_TYPE}" != "tag" ]; then
35
+ echo "Publish must be run from a release tag, not ${GITHUB_REF_TYPE}: ${GITHUB_REF_NAME}" >&2
36
+ exit 1
37
+ fi
38
+ case "${GITHUB_REF_NAME}" in
39
+ v*) ;;
40
+ *)
41
+ echo "Publish tag must start with 'v': ${GITHUB_REF_NAME}" >&2
42
+ exit 1
43
+ ;;
44
+ esac
45
+
46
+ - name: Install uv
47
+ uses: astral-sh/setup-uv@v8.1.0
48
+ with:
49
+ enable-cache: true
50
+
51
+ - name: Set up Python
52
+ uses: actions/setup-python@v6
53
+ with:
54
+ python-version: "3.14"
55
+
56
+ - name: Install dependencies
57
+ run: uv sync --locked --python 3.14
58
+
59
+ - name: Verify tag matches package version
60
+ run: |
61
+ PACKAGE_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
62
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
63
+ if [ "${PACKAGE_VERSION}" != "${TAG_VERSION}" ]; then
64
+ echo "Package version ${PACKAGE_VERSION} does not match tag ${GITHUB_REF_NAME}" >&2
65
+ exit 1
66
+ fi
67
+
68
+ - name: Run tests
69
+ run: uv run pytest
70
+
71
+ - name: Build artifacts
72
+ run: uv build
73
+
74
+ - name: Check artifact metadata
75
+ run: uv run twine check dist/*
76
+
77
+ - name: Upload artifacts
78
+ uses: actions/upload-artifact@v7.0.1
79
+ with:
80
+ name: release-distributions
81
+ path: dist/*
82
+ if-no-files-found: error
83
+
84
+ publish:
85
+ name: Publish to ${{ inputs.repository }}
86
+ runs-on: ubuntu-latest
87
+ needs: build
88
+ environment: ${{ inputs.repository }}
89
+
90
+ steps:
91
+ - name: Download artifacts
92
+ uses: actions/download-artifact@v8.0.1
93
+ with:
94
+ name: release-distributions
95
+ path: dist
96
+
97
+ - name: Publish to TestPyPI
98
+ if: inputs.repository == 'testpypi'
99
+ uses: pypa/gh-action-pypi-publish@release/v1
100
+ with:
101
+ repository-url: https://test.pypi.org/legacy/
102
+
103
+ - name: Publish to PyPI
104
+ if: inputs.repository == 'pypi'
105
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,8 @@
1
+ .DS_Store
2
+ .venv/
3
+ .pytest_cache/
4
+ __pycache__/
5
+ *.py[cod]
6
+ dist/
7
+ build/
8
+ *.egg-info/
@@ -0,0 +1,75 @@
1
+ # AGENTS.md
2
+
3
+ ## Project Mission
4
+
5
+ This repository is maintained as a careful, community-oriented Python client for the PrintNode API. Prioritize correctness, compatibility, clear releases, and a learning-friendly development workflow.
6
+
7
+ ## Branch and PR Rules
8
+
9
+ - The default branch is `main`.
10
+ - Do not commit directly to `main`.
11
+ - Use a focused branch and pull request for every meaningful change.
12
+ - Keep pull requests small enough to review.
13
+ - Require tests and CI before merge whenever the change affects code, packaging, or release behavior.
14
+ - Treat default-branch migration and repository settings as explicit maintenance tasks.
15
+ - Do not push branches or open pull requests unless the user explicitly asks for that action.
16
+
17
+ ## Python Project Standards
18
+
19
+ - Use `pyproject.toml` as the project source of truth.
20
+ - Use `uv` for local development, dependency locking, testing, and builds.
21
+ - Keep `uv.lock` committed for reproducible development and CI once `uv` is introduced.
22
+ - Preserve the `printnode_community` import path unless a breaking-change pull request explicitly changes it.
23
+ - Prefer modern Python packaging practices while avoiding unnecessary rewrites.
24
+
25
+ ## Dependency Maintenance
26
+
27
+ - Keep Dependabot enabled for every dependency surface in the repository.
28
+ - Configure Dependabot for `uv`, GitHub Actions, and `pre-commit` when pre-commit hooks exist.
29
+ - Add new Dependabot ecosystems when new manifests are introduced.
30
+ - Dependabot pull requests must pass the same CI as human pull requests.
31
+
32
+ ## Testing Standards
33
+
34
+ - The default test suite must not require real PrintNode credentials.
35
+ - Use mocked HTTP tests for normal CI.
36
+ - Gate live PrintNode API tests behind explicit environment variables.
37
+ - Add or update tests for behavior changes.
38
+ - Do not remove coverage just because legacy tests are awkward.
39
+
40
+ ## Release Standards
41
+
42
+ - Do not publish releases from unreviewed local state.
43
+ - Build and validate distributions before release.
44
+ - Prefer TestPyPI before first publishing under a new distribution name, but allow skipping it when CI, build metadata checks, and release-tag guards are sufficient.
45
+ - Run the manual `Publish` workflow from a `v*` release tag only.
46
+ - Keep the `testpypi` environment unblocked by manual review.
47
+ - Do not require GitHub environment review for `pypi`; treat release PR merge,
48
+ tag creation, and manual workflow dispatch as the publish approval path.
49
+ - Trusted publishers must match project `printnode_community`, owner `cbusillo`, repository `printnode_community`, workflow `publish.yml`, and environment `testpypi` or `pypi`.
50
+ - Update `CHANGELOG.md` for user-visible changes.
51
+ - Keep release notes clear about whether this is an official PrintNode release or a community-maintained fork.
52
+ - Preserve `printnode_community` as the import package.
53
+
54
+ ## Local Verification
55
+
56
+ Use `uv` by default:
57
+
58
+ ```sh
59
+ uv sync
60
+ uv run pytest
61
+ uv build
62
+ uv run twine check dist/*
63
+ ```
64
+
65
+ If a command cannot be run locally, mention why in the pull request body.
66
+
67
+ ## Code Agent Notes
68
+
69
+ - Use `rg` or `fd` for searching.
70
+ - Use `apply_patch` for file edits.
71
+ - Do not overwrite user changes.
72
+ - Do not run destructive git commands.
73
+ - Prefer pull-request-backed work and summarize verification clearly.
74
+ - Keep changes boring, reviewable, and well-tested.
75
+ - Update the durable stewardship plan at `~/.codex/plans/printnode-python-stewardship.md` when major phases start, finish, or change.
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ All notable changes to this community-maintained fork will be documented in this file.
4
+
5
+ The format follows the spirit of Keep a Changelog, and this project intends to use semantic versioning once the first maintained release is cut.
6
+
7
+ ## Unreleased
8
+
9
+ - Nothing yet.
10
+
11
+ ## 0.3.0 - 2026-04-26
12
+
13
+ ### Added
14
+
15
+ - Added repository governance documentation for community maintenance.
16
+ - Added contribution, security, issue, and pull request guidance.
17
+ - Added modern Python project metadata in `pyproject.toml`.
18
+ - Added an initial `uv` development workflow.
19
+ - Added release process documentation and a manual trusted-publishing workflow scaffold.
20
+ - Added `printnode_community` as the import namespace.
21
+
22
+ ### Changed
23
+
24
+ - Selected `printnode_community` as the maintained project, distribution, and import name.
25
+ - Documented the plan to migrate the default branch from `master` to `main`.
26
+ - Migrated the default branch from `master` to `main`.
27
+ - Replaced legacy `setup.py` packaging with `pyproject.toml`.
28
+ - Replaced legacy live-credential test guidance with credential-free `uv` test instructions.
29
+
30
+ ### Removed
31
+
32
+ - Removed stale placeholder credential and fixture files from the legacy live test setup.
33
+
34
+ ### Notes
35
+
36
+ - This fork is not an official PrintNode release unless PrintNode explicitly confirms maintainership or transfer.
@@ -0,0 +1,42 @@
1
+ # Contributing
2
+
3
+ Thank you for helping maintain this PrintNode API client. This fork aims to be careful, compatible, and easy to learn from.
4
+
5
+ ## Workflow
6
+
7
+ - Open a focused pull request for every meaningful change.
8
+ - Do not commit directly to `main`.
9
+ - Keep changes small and reviewable.
10
+ - Include tests for behavior changes.
11
+ - Update documentation when user-facing behavior changes.
12
+ - Mention any command you could not run in the pull request body.
13
+
14
+ ## Development
15
+
16
+ The project uses `pyproject.toml` and `uv`. The standard local workflow is:
17
+
18
+ ```sh
19
+ uv sync
20
+ uv run pytest
21
+ ```
22
+
23
+ Build checks will use:
24
+
25
+ ```sh
26
+ uv build
27
+ uv run twine check dist/*
28
+ ```
29
+
30
+ ## Tests
31
+
32
+ Default tests must not require real PrintNode credentials. Use mocked HTTP responses for normal test coverage.
33
+
34
+ Live PrintNode API tests may be added, but they must be opt-in and gated by environment variables so they never run accidentally in CI or on contributor machines.
35
+
36
+ ## Compatibility
37
+
38
+ Preserve the `printnode_community` import path. Breaking changes require an explicit pull request, changelog entry, and release note.
39
+
40
+ ## Releases
41
+
42
+ Releases are cut only from reviewed code that has passed CI. New distribution names must be tested on TestPyPI before publishing to PyPI.
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 PrintNode Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+