codext 1.15.11__tar.gz → 1.16.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.
- codext-1.16.0/.github/ISSUE_TEMPLATE/add-encoding.yml +21 -0
- codext-1.16.0/.github/copilot-instructions.md +81 -0
- codext-1.16.0/.github/prompts/add_codec.prompt.md +17 -0
- codext-1.16.0/.github/pull_request_template.md +8 -0
- {codext-1.15.11 → codext-1.16.0}/.github/workflows/python-package.yml +43 -28
- {codext-1.15.11 → codext-1.16.0}/LICENSE +674 -674
- {codext-1.15.11 → codext-1.16.0}/PKG-INFO +28 -18
- {codext-1.15.11 → codext-1.16.0}/README.md +27 -17
- {codext-1.15.11 → codext-1.16.0}/docs/mkdocs.yml +3 -2
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/crypto.md +91 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/others.md +79 -79
- {codext-1.15.11 → codext-1.16.0}/docs/pages/howto.md +40 -22
- codext-1.16.0/docs/requirements.txt +5 -0
- codext-1.16.0/src/codext/VERSION.txt +1 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/__common__.py +7 -19
- {codext-1.15.11 → codext-1.16.0}/src/codext/__info__.py +16 -16
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/__init__.py +64 -64
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/_base.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/_base2n.py +112 -112
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/base100.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/base122.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/base45.py +84 -84
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/base85.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/base91.py +113 -113
- {codext-1.15.11 → codext-1.16.0}/src/codext/base/baseN.py +132 -132
- {codext-1.15.11 → codext-1.16.0}/src/codext/binary/__init__.py +8 -8
- {codext-1.15.11 → codext-1.16.0}/src/codext/binary/baudot.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/binary/bcd.py +80 -80
- {codext-1.15.11 → codext-1.16.0}/src/codext/binary/excess3.py +65 -65
- {codext-1.15.11 → codext-1.16.0}/src/codext/binary/gray.py +25 -25
- {codext-1.15.11 → codext-1.16.0}/src/codext/binary/manchester.py +50 -50
- {codext-1.15.11 → codext-1.16.0}/src/codext/binary/rotate.py +0 -0
- codext-1.16.0/src/codext/checksums/__init__.py +5 -0
- codext-1.16.0/src/codext/checksums/adler.py +17 -0
- codext-1.15.11/src/codext/hashing/checksums.py → codext-1.16.0/src/codext/checksums/crc.py +8 -11
- codext-1.16.0/src/codext/checksums/luhn.py +33 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/common/__init__.py +7 -7
- {codext-1.15.11 → codext-1.16.0}/src/codext/common/a1z26.py +60 -60
- {codext-1.15.11 → codext-1.16.0}/src/codext/common/dummy.py +57 -57
- {codext-1.15.11 → codext-1.16.0}/src/codext/common/octal.py +31 -31
- {codext-1.15.11 → codext-1.16.0}/src/codext/common/ordinal.py +28 -28
- {codext-1.15.11 → codext-1.16.0}/src/codext/compressions/__init__.py +12 -12
- {codext-1.15.11 → codext-1.16.0}/src/codext/compressions/gzipp.py +44 -44
- {codext-1.15.11 → codext-1.16.0}/src/codext/compressions/pkzip.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/__init__.py +14 -12
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/affine.py +32 -32
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/atbash.py +34 -34
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/bacon.py +36 -36
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/barbie.py +54 -54
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/citrix.py +52 -52
- codext-1.16.0/src/codext/crypto/polybius.py +77 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/rot.py +102 -102
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/scytale.py +54 -54
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/shift.py +34 -34
- codext-1.16.0/src/codext/crypto/vigenere.py +87 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/xor.py +35 -35
- {codext-1.15.11 → codext-1.16.0}/src/codext/hashing/__init__.py +0 -1
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/__init__.py +12 -12
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/braille.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/ipsum.py +97 -97
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/leetspeak.py +23 -23
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/morse.py +40 -40
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/navajo.py +35 -35
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/radio.py +29 -29
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/southpark.py +44 -44
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/tomtom.py +35 -35
- {codext-1.15.11 → codext-1.16.0}/src/codext/others/__init__.py +7 -7
- {codext-1.15.11 → codext-1.16.0}/src/codext/others/dna.py +42 -42
- {codext-1.15.11 → codext-1.16.0}/src/codext/others/kbshift.py +66 -66
- {codext-1.15.11 → codext-1.16.0}/src/codext/others/letters.py +91 -91
- {codext-1.15.11 → codext-1.16.0}/src/codext/others/markdown.py +22 -22
- {codext-1.15.11 → codext-1.16.0}/src/codext/stegano/__init__.py +8 -8
- {codext-1.15.11 → codext-1.16.0}/src/codext/stegano/hexagram.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/stegano/klopf.py +25 -25
- {codext-1.15.11 → codext-1.16.0}/src/codext/stegano/resistor.py +28 -28
- {codext-1.15.11 → codext-1.16.0}/src/codext/stegano/rick.py +31 -31
- {codext-1.15.11 → codext-1.16.0}/src/codext/stegano/sms.py +27 -27
- {codext-1.15.11 → codext-1.16.0}/src/codext/stegano/whitespace.py +71 -71
- {codext-1.15.11 → codext-1.16.0}/src/codext/web/__init__.py +4 -4
- {codext-1.15.11 → codext-1.16.0}/src/codext/web/html.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/web/url.py +29 -29
- {codext-1.15.11 → codext-1.16.0}/src/codext.egg-info/PKG-INFO +28 -18
- {codext-1.15.11 → codext-1.16.0}/src/codext.egg-info/SOURCES.txt +10 -1
- {codext-1.15.11 → codext-1.16.0}/tests/test_manual.py +19 -9
- codext-1.15.11/docs/requirements.txt +0 -6
- codext-1.15.11/src/codext/VERSION.txt +0 -1
- {codext-1.15.11 → codext-1.16.0}/.coveragerc +0 -0
- {codext-1.15.11 → codext-1.16.0}/.gitignore +0 -0
- {codext-1.15.11 → codext-1.16.0}/.readthedocs.yml +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/coverage.svg +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/cli.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/css/extra.css +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/demos/using-bases.gif +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/demos/using-codext.gif +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/demos/using-debase.gif +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/base.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/binary.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/common.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/compressions.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/hashing.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/languages.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/stegano.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/enc/web.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/features.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/guessing.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/img/banner.png +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/img/icon.png +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/img/logo.png +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/index.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/docs/pages/manipulations.md +0 -0
- {codext-1.15.11 → codext-1.16.0}/pyproject.toml +0 -0
- {codext-1.15.11 → codext-1.16.0}/pytest.ini +0 -0
- {codext-1.15.11 → codext-1.16.0}/requirements.txt +0 -0
- {codext-1.15.11 → codext-1.16.0}/setup.cfg +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/__init__.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/common/cases.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/compressions/lz77.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/compressions/lz78.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/crypto/railfence.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/hashing/blake.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/hashing/crypt.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/hashing/md.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/hashing/mmh3.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/hashing/sha.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/hashing/shake.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/galactic.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/languages/tap.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/macros.json +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext/others/uuencode.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext.egg-info/dependency_links.txt +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext.egg-info/entry_points.txt +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext.egg-info/requires.txt +0 -0
- {codext-1.15.11 → codext-1.16.0}/src/codext.egg-info/top_level.txt +0 -0
- {codext-1.15.11 → codext-1.16.0}/tests/__init__.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/tests/test_base.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/tests/test_common.py +0 -0
- {codext-1.15.11 → codext-1.16.0}/tests/test_generated.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Add new encoding
|
|
2
|
+
description: Propose a new encoding to be added
|
|
3
|
+
title: "Add new encoding: [codec]"
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: description
|
|
8
|
+
attributes:
|
|
9
|
+
label: Description
|
|
10
|
+
description: Describe the encoding, its purpose, and how it works
|
|
11
|
+
placeholder: Provide a clear and concise description
|
|
12
|
+
validations:
|
|
13
|
+
required: true
|
|
14
|
+
- type: input
|
|
15
|
+
id: reference
|
|
16
|
+
attributes:
|
|
17
|
+
label: Reference
|
|
18
|
+
description: Provide a reference URL for the encoding
|
|
19
|
+
placeholder: https://
|
|
20
|
+
validations:
|
|
21
|
+
required: false
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Copilot Instructions — Enhancements Only
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
This repository focuses on **adding new encoding/decoding schemes only**.
|
|
5
|
+
|
|
6
|
+
Copilot MUST:
|
|
7
|
+
- Propose **new codecs only**
|
|
8
|
+
- Avoid refactoring unrelated code
|
|
9
|
+
- Avoid dependency changes unless strictly required for the codec
|
|
10
|
+
- Avoid stylistic or formatting changes
|
|
11
|
+
|
|
12
|
+
## Context
|
|
13
|
+
This project extends Python's codecs with many encoding/decoding schemes and a CLI tool.
|
|
14
|
+
It already includes a wide variety of bases, ciphers, compression, and niche encodings.
|
|
15
|
+
|
|
16
|
+
## Enhancement Guidelines
|
|
17
|
+
When adding a new encoding, follow the guideline in the documentation at `docs/pages/howto.md`.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Implementation Constraints
|
|
21
|
+
|
|
22
|
+
- Pure Python preferred
|
|
23
|
+
- No heavy dependencies
|
|
24
|
+
- Deterministic transformations only
|
|
25
|
+
- Reversible encoding required unless explicitly documented
|
|
26
|
+
|
|
27
|
+
## Testing
|
|
28
|
+
|
|
29
|
+
Every new codec:
|
|
30
|
+
- SHOULD include a list of `__examples__` that tells the automated tests what encoding/decoding transformations need to be verified ; it this cannot be made, unit tests (encode/decode roundtrip) SHALL be provided in `tests/test_manual.py`
|
|
31
|
+
- Edge cases (empty input, binary data if applicable), either in the `__examples__` list or in the explicit tests in `tests/test_manual.py`
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
Each codec SHALL comply with the following structure:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
# -*- coding: UTF-8 -*-
|
|
39
|
+
"""{{codec_long_name}} Codec - {{codec_short_name}} content encoding.
|
|
40
|
+
|
|
41
|
+
{{codec_description}}
|
|
42
|
+
|
|
43
|
+
This codec:
|
|
44
|
+
- en/decodes strings from str to str
|
|
45
|
+
- en/decodes strings from bytes to bytes
|
|
46
|
+
- decodes file content to str (read)
|
|
47
|
+
- encodes file content from str to bytes (write)
|
|
48
|
+
|
|
49
|
+
Reference: {{codec_source_hyperlink}}
|
|
50
|
+
"""
|
|
51
|
+
from ..__common__ import *
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
__examples__ = {<<dictionary of examples with, as keys, a special format detailed hereafter and, as values, a dictionary mapping source to destination values (see sectino _Self-generated tests_)>>}
|
|
55
|
+
<<optional list of valid codec names to be used with the guessing mode (see _Codec names for the guessing mode_), in format "__guess__ = [...]">>]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<<constants here, including ENCMAP if the codec is a simple mapping (see section _Case 2: Encoding map_)>>
|
|
59
|
+
<<functions here, if the codec requires some additional logic, i.e. when it is not a mapping (see section _Case 1: Generic encoding definition_)>>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
<<put the right add function (see section _Which `add` function ?_) here with its relevant parameters (see section _Generic arguments_)>>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
In this template, `{{ ... }}` enclosures indicate codec's properties and `<< ... >>``enclosures indicate placeholder actions referring to steps from the documentation about how to make a codec at `docs/pages/howto.md`.
|
|
66
|
+
|
|
67
|
+
## Output Format (IMPORTANT)
|
|
68
|
+
|
|
69
|
+
When asked to add a codec, Copilot should:
|
|
70
|
+
1. Briefly justify the encoding (1–2 lines)
|
|
71
|
+
2. Provide full implementation (according to section _Adding a new codec to `codext`_ of the documentation at `docs/pages/howto.md`)
|
|
72
|
+
3. Provide tests (according to section _Self-generated tests_)
|
|
73
|
+
4. Add it to the `README.md` of the repository
|
|
74
|
+
5. Propose the update of the documentation (under the relevant page for the category of codec)
|
|
75
|
+
|
|
76
|
+
## Explicit Non-Goals
|
|
77
|
+
|
|
78
|
+
- No refactoring
|
|
79
|
+
- No performance optimization passes
|
|
80
|
+
- No linting-only changes
|
|
81
|
+
- No CI/CD changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Add a new encoding scheme to this repository.
|
|
2
|
+
|
|
3
|
+
Constraints:
|
|
4
|
+
- Follow copilot-instructions.md strictly
|
|
5
|
+
- Do not modify unrelated code
|
|
6
|
+
- Use existing codec patterns
|
|
7
|
+
|
|
8
|
+
Task:
|
|
9
|
+
Add encoding: {{ENCODING_NAME}}
|
|
10
|
+
|
|
11
|
+
Requirements:
|
|
12
|
+
- Implement according to ADDING_CODECS.md guideline
|
|
13
|
+
- Add tests if needed (if `__examples__` cannot be consistently defined)
|
|
14
|
+
- Add minimal documentation (in the relevant category page under `docs/pages`)
|
|
15
|
+
|
|
16
|
+
Reference:
|
|
17
|
+
{{LINK_OR_DESCRIPTION}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## Checklist
|
|
2
|
+
- [ ] No unrelated changes
|
|
3
|
+
- [ ] Codec is new (not already implemented)
|
|
4
|
+
- [ ] Tests included (if cannot be automated with `tests/test_generated`)
|
|
5
|
+
- [ ] Documentation (included in the right page in `docs/pages/enc`)
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
Explain the encoding and its source.
|
|
@@ -3,27 +3,41 @@
|
|
|
3
3
|
|
|
4
4
|
name: build
|
|
5
5
|
|
|
6
|
-
env:
|
|
7
|
-
package: codext
|
|
8
|
-
|
|
9
6
|
on:
|
|
10
7
|
push:
|
|
11
8
|
branches: [ "main" ]
|
|
12
9
|
pull_request:
|
|
13
10
|
branches: [ "main" ]
|
|
14
11
|
|
|
12
|
+
permissions:
|
|
13
|
+
id-token: write
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
15
16
|
jobs:
|
|
17
|
+
prepare:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
outputs:
|
|
20
|
+
package: ${{ steps.pkg.outputs.package }}
|
|
21
|
+
steps:
|
|
22
|
+
- name: Compute package name from the repository's
|
|
23
|
+
id: pkg
|
|
24
|
+
run: |
|
|
25
|
+
name="${GITHUB_REPOSITORY##*/}"
|
|
26
|
+
echo "package=${name#python-}" >> $GITHUB_OUTPUT
|
|
16
27
|
build:
|
|
28
|
+
needs: prepare
|
|
17
29
|
runs-on: ${{ matrix.os }}
|
|
18
30
|
strategy:
|
|
19
31
|
fail-fast: false
|
|
20
32
|
matrix:
|
|
21
33
|
os: [ubuntu-latest]
|
|
22
34
|
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
35
|
+
env:
|
|
36
|
+
package: ${{ needs.prepare.outputs.package }}
|
|
23
37
|
steps:
|
|
24
|
-
- uses: actions/checkout@
|
|
38
|
+
- uses: actions/checkout@v5
|
|
25
39
|
- name: Set up Python ${{ matrix.python-version }}
|
|
26
|
-
uses: actions/setup-python@
|
|
40
|
+
uses: actions/setup-python@v6
|
|
27
41
|
with:
|
|
28
42
|
python-version: ${{ matrix.python-version }}
|
|
29
43
|
- name: Install ${{ env.package }}
|
|
@@ -37,16 +51,23 @@ jobs:
|
|
|
37
51
|
run: |
|
|
38
52
|
pytest --cov=$package
|
|
39
53
|
coverage:
|
|
40
|
-
needs: build
|
|
54
|
+
needs: [prepare, build]
|
|
55
|
+
permissions:
|
|
56
|
+
contents: write
|
|
41
57
|
runs-on: ubuntu-latest
|
|
42
58
|
env:
|
|
43
59
|
cov_badge_path: docs/coverage.svg
|
|
60
|
+
package: ${{ needs.prepare.outputs.package }}
|
|
61
|
+
python_version: "3.13"
|
|
44
62
|
steps:
|
|
45
|
-
- uses: actions/checkout@
|
|
46
|
-
- name: Set up Python ${{ matrix.python-version }}
|
|
47
|
-
uses: actions/setup-python@v4
|
|
63
|
+
- uses: actions/checkout@v5
|
|
48
64
|
with:
|
|
49
|
-
|
|
65
|
+
fetch-depth: 0
|
|
66
|
+
ref: ${{ github.head_ref || github.ref_name }}
|
|
67
|
+
- name: Set up Python ${{ env.python_version }}
|
|
68
|
+
uses: actions/setup-python@v6
|
|
69
|
+
with:
|
|
70
|
+
python-version: ${{ env.python_version }}
|
|
50
71
|
- name: Install ${{ env.package }}
|
|
51
72
|
run: |
|
|
52
73
|
python -m pip install --upgrade pip
|
|
@@ -59,32 +80,30 @@ jobs:
|
|
|
59
80
|
pytest --cov=$package --cov-report=xml
|
|
60
81
|
genbadge coverage -i coverage.xml -o $cov_badge_path
|
|
61
82
|
- name: Verify Changed files
|
|
62
|
-
uses: tj-actions/verify-changed-files@
|
|
83
|
+
uses: tj-actions/verify-changed-files@v20
|
|
63
84
|
id: changed_files
|
|
64
85
|
with:
|
|
65
86
|
files: ${{ env.cov_badge_path }}
|
|
66
|
-
- name:
|
|
87
|
+
- name: Push coverage badge
|
|
67
88
|
if: steps.changed_files.outputs.files_changed == 'true'
|
|
68
89
|
run: |
|
|
69
90
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
70
91
|
git config --local user.name "github-actions[bot]"
|
|
92
|
+
git fetch origin
|
|
93
|
+
git checkout coverage-badge || git checkout -b coverage-badge
|
|
71
94
|
git add $cov_badge_path
|
|
72
|
-
git
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
uses: ad-m/github-push-action@master
|
|
76
|
-
with:
|
|
77
|
-
github_token: ${{ secrets.github_token }}
|
|
78
|
-
branch: ${{ github.ref }}
|
|
95
|
+
git diff --cached --quiet && exit 0
|
|
96
|
+
git commit -m "Update coverage badge"
|
|
97
|
+
git push origin coverage-badge --force
|
|
79
98
|
deploy:
|
|
80
99
|
runs-on: ubuntu-latest
|
|
81
|
-
needs: coverage
|
|
100
|
+
needs: [prepare, coverage]
|
|
82
101
|
steps:
|
|
83
|
-
- uses: actions/checkout@
|
|
102
|
+
- uses: actions/checkout@v5
|
|
84
103
|
with:
|
|
85
104
|
fetch-depth: 0
|
|
86
105
|
- name: Check for version change
|
|
87
|
-
uses: dorny/paths-filter@
|
|
106
|
+
uses: dorny/paths-filter@v4
|
|
88
107
|
id: filter
|
|
89
108
|
with:
|
|
90
109
|
filters: |
|
|
@@ -97,12 +116,8 @@ jobs:
|
|
|
97
116
|
awk '{if (match($0,"## Supporters")) exit; print}' README.md > README
|
|
98
117
|
mv -f README README.md
|
|
99
118
|
- if: steps.filter.outputs.version == 'true'
|
|
100
|
-
name: Build ${{
|
|
119
|
+
name: Build ${{ needs.prepare.outputs.package }} package
|
|
101
120
|
run: python3 -m pip install --upgrade build && python3 -m build
|
|
102
121
|
- if: steps.filter.outputs.version == 'true'
|
|
103
|
-
name:
|
|
122
|
+
name: Publish to PyPI
|
|
104
123
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
105
|
-
with:
|
|
106
|
-
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
107
|
-
verbose: true
|
|
108
|
-
verify_metadata: false
|