plexer-cli 0.0.1.post4__tar.gz → 0.0.3__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 (29) hide show
  1. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.github/workflows/release.yml +13 -11
  2. plexer_cli-0.0.3/.github/workflows/release_docker_image.yml +88 -0
  3. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/=1.2 +10 -10
  4. plexer_cli-0.0.3/Dockerfile +38 -0
  5. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/PKG-INFO +31 -5
  6. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/README.md +29 -3
  7. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/pyproject.toml +5 -5
  8. plexer_cli-0.0.1.post4/plexer.py → plexer_cli-0.0.3/src/plexer_cli/main.py +23 -20
  9. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/tests/test_file_manager.py +2 -2
  10. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/tests/test_metadata.py +2 -2
  11. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.codacy.yml +0 -0
  12. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  13. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  14. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  15. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.github/dependabot.yml +0 -0
  16. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.github/workflows/openssf_scorecard.yml +0 -0
  17. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.github/workflows/run_full_test_suite.yml +0 -0
  18. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.gitignore +0 -0
  19. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/.pre-commit-config.yaml +0 -0
  20. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/CODE_OF_CONDUCT.md +0 -0
  21. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/LICENSE +0 -0
  22. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/SECURITY.md +0 -0
  23. {plexer_cli-0.0.1.post4/src/plexer → plexer_cli-0.0.3/src/plexer_cli}/__init__.py +0 -0
  24. {plexer_cli-0.0.1.post4/src/plexer → plexer_cli-0.0.3/src/plexer_cli}/artifact.py +0 -0
  25. {plexer_cli-0.0.1.post4/src/plexer → plexer_cli-0.0.3/src/plexer_cli}/const.py +0 -0
  26. {plexer_cli-0.0.1.post4/src/plexer → plexer_cli-0.0.3/src/plexer_cli}/file_manager.py +0 -0
  27. {plexer_cli-0.0.1.post4/src/plexer → plexer_cli-0.0.3/src/plexer_cli}/metadata.py +0 -0
  28. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/tests/conftest.py +0 -0
  29. {plexer_cli-0.0.1.post4 → plexer_cli-0.0.3}/tox.ini +0 -0
@@ -13,8 +13,10 @@ jobs:
13
13
  environment: release
14
14
 
15
15
  permissions:
16
+ attestations: write
16
17
  contents: write # needed to create GH Release
17
18
  id-token: write # IMPORTANT: this permission is mandatory for trusted publishing to PyPI
19
+ packages: write # required for pushing image to GHCR
18
20
 
19
21
  steps:
20
22
  - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -43,17 +45,6 @@ jobs:
43
45
  - name: Build dist artifacts
44
46
  run: hatch build
45
47
 
46
- # Github Release
47
- - name: Create Github Release
48
- uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
49
- with:
50
- name:
51
- files: |
52
- dist/*
53
- fail_on_unmatched_files: true
54
- generate_release_notes: true
55
- make_latest: true
56
-
57
48
  # PyPI Release
58
49
  # required instead of using hatch due to usage of trusted publishers
59
50
  - name: Publish to TestPyPI
@@ -67,4 +58,15 @@ jobs:
67
58
  uses: pypa/gh-action-pypi-publish@897895f1e160c830e369f9779632ebc134688e1b # v1.10.2
68
59
  with:
69
60
  attestations: true
61
+
62
+ # Github Release
63
+ - name: Create Github Release
64
+ uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
65
+ with:
66
+ name:
67
+ files: |
68
+ dist/*
69
+ fail_on_unmatched_files: true
70
+ generate_release_notes: true
71
+ make_latest: true
70
72
 
@@ -0,0 +1,88 @@
1
+ name: Release - Docker Images
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ docker_release:
9
+ name: Push Docker Image Release - ${{ github.ref_name }}
10
+ runs-on: ubuntu-latest
11
+ environment: release
12
+
13
+ strategy:
14
+ matrix:
15
+ container_repos: ["docker.io", "ghcr.io"]
16
+
17
+ permissions:
18
+ attestations: write
19
+ contents: read
20
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing to PyPI
21
+ packages: write # required for pushing image to GHCR
22
+
23
+ steps:
24
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
25
+ with:
26
+ fetch-depth: 0
27
+
28
+ - name: Setup python for build
29
+ uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
30
+ with:
31
+ python-version: "3.x"
32
+
33
+ # run tests
34
+ - name: Install tox
35
+ run: python -m pip install tox-gh>=1.2
36
+
37
+ - name: Setup test suite
38
+ run: tox -vv --notest -e test
39
+
40
+ - name: Run test suite
41
+ run: tox --skip-pkg-install -e test
42
+
43
+ # build and publish
44
+ - name: Install Hatch
45
+ run: pipx install hatch
46
+
47
+ - name: Build dist artifacts
48
+ run: hatch build
49
+
50
+ # Docker Release
51
+ # REF: https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub-and-github-packages
52
+ - name: Log in to Docker Hub
53
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
54
+ with:
55
+ username: ${{ secrets.DOCKER_USERNAME }}
56
+ password: ${{ secrets.DOCKER_PASSWORD }}
57
+
58
+ - name: Log in to Github Container registry
59
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
60
+ with:
61
+ registry: ghcr.io
62
+ username: ${{ github.actor }}
63
+ password: ${{ secrets.GITHUB_TOKEN }}
64
+
65
+ - name: Extract metadata (tags, labels) for Docker
66
+ id: meta
67
+ uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
68
+ with:
69
+ images: |
70
+ magneticstain/${{ github.repository }}
71
+ ghcr.io/${{ github.repository }}
72
+
73
+ - name: Build and push Docker images to all registries
74
+ id: push
75
+ uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
76
+ with:
77
+ context: .
78
+ push: true
79
+ tags: ${{ steps.meta.outputs.tags }}
80
+ labels: ${{ steps.meta.outputs.labels }}
81
+
82
+ - name: Generate artifact attestation for GHCR
83
+ uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
84
+ with:
85
+ subject-name: ghcr.io/${{ github.repository }}
86
+ subject-digest: ${{ steps.push.outputs.digest }}
87
+ push-to-registry: true
88
+
@@ -1,7 +1,7 @@
1
1
  Collecting tox-gh
2
- Downloading tox_gh-1.4.1-py3-none-any.whl.metadata (5.5 kB)
2
+ Downloading tox_gh-1.4.4-py3-none-any.whl.metadata (6.5 kB)
3
3
  Collecting tox>=4.18.1 (from tox-gh)
4
- Downloading tox-4.21.2-py3-none-any.whl.metadata (5.0 kB)
4
+ Downloading tox-4.23.0-py3-none-any.whl.metadata (3.6 kB)
5
5
  Collecting cachetools>=5.5 (from tox>=4.18.1->tox-gh)
6
6
  Downloading cachetools-5.5.0-py3-none-any.whl.metadata (5.3 kB)
7
7
  Collecting chardet>=5.2 (from tox>=4.18.1->tox-gh)
@@ -19,11 +19,11 @@ Collecting pluggy>=1.5 (from tox>=4.18.1->tox-gh)
19
19
  Collecting pyproject-api>=1.8 (from tox>=4.18.1->tox-gh)
20
20
  Downloading pyproject_api-1.8.0-py3-none-any.whl.metadata (2.7 kB)
21
21
  Collecting virtualenv>=20.26.6 (from tox>=4.18.1->tox-gh)
22
- Downloading virtualenv-20.26.6-py3-none-any.whl.metadata (4.5 kB)
22
+ Downloading virtualenv-20.27.0-py3-none-any.whl.metadata (4.5 kB)
23
23
  Collecting distlib<1,>=0.3.7 (from virtualenv>=20.26.6->tox>=4.18.1->tox-gh)
24
- Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)
25
- Downloading tox_gh-1.4.1-py3-none-any.whl (6.7 kB)
26
- Downloading tox-4.21.2-py3-none-any.whl (165 kB)
24
+ Downloading distlib-0.3.9-py2.py3-none-any.whl.metadata (5.2 kB)
25
+ Downloading tox_gh-1.4.4-py3-none-any.whl (6.8 kB)
26
+ Downloading tox-4.23.0-py3-none-any.whl (166 kB)
27
27
  Downloading cachetools-5.5.0-py3-none-any.whl (9.5 kB)
28
28
  Downloading chardet-5.2.0-py3-none-any.whl (199 kB)
29
29
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
@@ -32,8 +32,8 @@ Downloading packaging-24.1-py3-none-any.whl (53 kB)
32
32
  Downloading platformdirs-4.3.6-py3-none-any.whl (18 kB)
33
33
  Downloading pluggy-1.5.0-py3-none-any.whl (20 kB)
34
34
  Downloading pyproject_api-1.8.0-py3-none-any.whl (13 kB)
35
- Downloading virtualenv-20.26.6-py3-none-any.whl (6.0 MB)
36
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.0/6.0 MB 102.0 MB/s eta 0:00:00
37
- Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
35
+ Downloading virtualenv-20.27.0-py3-none-any.whl (3.1 MB)
36
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 46.8 MB/s eta 0:00:00
37
+ Downloading distlib-0.3.9-py2.py3-none-any.whl (468 kB)
38
38
  Installing collected packages: distlib, pluggy, platformdirs, packaging, filelock, colorama, chardet, cachetools, virtualenv, pyproject-api, tox, tox-gh
39
- Successfully installed cachetools-5.5.0 chardet-5.2.0 colorama-0.4.6 distlib-0.3.8 filelock-3.16.1 packaging-24.1 platformdirs-4.3.6 pluggy-1.5.0 pyproject-api-1.8.0 tox-4.21.2 tox-gh-1.4.1 virtualenv-20.26.6
39
+ Successfully installed cachetools-5.5.0 chardet-5.2.0 colorama-0.4.6 distlib-0.3.9 filelock-3.16.1 packaging-24.1 platformdirs-4.3.6 pluggy-1.5.0 pyproject-api-1.8.0 tox-4.23.0 tox-gh-1.4.4 virtualenv-20.27.0
@@ -0,0 +1,38 @@
1
+ # syntax=docker/dockerfile:1
2
+
3
+ FROM python:3.13-slim AS build
4
+
5
+ WORKDIR /build
6
+
7
+ RUN pip install pipx==1.7.1
8
+ RUN pipx install hatch==1.13.0
9
+
10
+ COPY . .
11
+
12
+ ENV PATH="$PATH:/root/.local/bin"
13
+
14
+ RUN hatch build
15
+
16
+ ########################
17
+
18
+ # linux/amd64 arch
19
+ FROM python:3.13-alpine@sha256:81362dd1ee15848b118895328e56041149e1521310f238ed5b2cdefe674e6dbf
20
+
21
+ RUN apk update && \
22
+ apk add libmagic
23
+
24
+ RUN addgroup --system --gid 888 plexer && \
25
+ adduser --system --uid 888 --ingroup plexer plexer
26
+
27
+ WORKDIR /app
28
+
29
+ COPY --chown=plexer:plexer --from=build /build/dist/ ./dist/
30
+
31
+ RUN python -m venv /app/venv
32
+ ENV PATH="/app/venv/bin:$PATH"
33
+ RUN pip install ./dist/plexer_cli-*.whl
34
+
35
+ USER plexer
36
+
37
+ ENTRYPOINT [ "/app/venv/bin/plexer" ]
38
+ CMD [ "--help" ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
- Name: plexer-cli
3
- Version: 0.0.1.post4
2
+ Name: plexer_cli
3
+ Version: 0.0.3
4
4
  Summary: Normalize media files for use with Plex Media Server
5
5
  Project-URL: Repository, https://github.com/magneticstain/plexer.git
6
6
  Project-URL: Documentation, https://github.com/magneticstain/plexer#readme
@@ -33,7 +33,7 @@ Description-Content-Type: text/markdown
33
33
 
34
34
  <!-- reenable once issue #27 is complete -->
35
35
  <!-- ![GitHub Release](https://img.shields.io/github/v/release/magneticstain/plexer?include_prereleases) -->
36
- ![PyPI - Version](https://img.shields.io/pypi/v/plexer-cli)
36
+ [![PyPI - Version](https://img.shields.io/pypi/v/plexer_cli)](https://pypi.org/project/plexer-cli/)
37
37
 
38
38
  ![GitHub License](https://img.shields.io/github/license/magneticstain/plexer)
39
39
  ![Supported Python Versions](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmagneticstain%2Fplexer%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
@@ -67,10 +67,36 @@ Currently, Plexer only supports organizing movies and other individual video fil
67
67
 
68
68
  ## Install
69
69
 
70
- To install plexer, us pip/[pipx](https://github.com/pypa/pipx)/[pipenv](https://pipenv.pypa.io/en/latest/)/your favorite build front-end to install the `plexer-cli` package.
70
+ To install Plexer, there are a few options available.
71
+
72
+ ### Docker
73
+
74
+ The most portable way to install and run Plexer is by using Docker.
75
+
76
+ #### Via Container Registry
77
+
78
+ The easiest way to run Plexer in Docker is by using the public containers hosted on container registries. Plexer images are available on both Docker Hub and GitHub Container Registry. See the commands below for how to run Plexer using each registry.
79
+
80
+ ##### Docker Hub
81
+
82
+ ```bash
83
+ docker run --rm -it magneticstain/plexer-cli
84
+ ```
85
+
86
+ ##### Github Container Registry
87
+
88
+ ```bash
89
+ docker run --rm -it ghcr.io/magneticstain/plexer-cli
90
+ ```
91
+
92
+ #### Via Local Build
93
+
94
+ In the case that container registries are unavailable, there's also the option to build the image locally. To do that, check out the `main` branch of this repo, build the Plexer image, and run it.
71
95
 
72
96
  ```bash
73
- pip install plexer-cli
97
+ git clone https://github.com/magneticstain/plexer-cli.git
98
+ docker build -t plexer_cli .
99
+ docker run --rm -it plexer_cli
74
100
  ```
75
101
 
76
102
  ## Requirements
@@ -2,7 +2,7 @@
2
2
 
3
3
  <!-- reenable once issue #27 is complete -->
4
4
  <!-- ![GitHub Release](https://img.shields.io/github/v/release/magneticstain/plexer?include_prereleases) -->
5
- ![PyPI - Version](https://img.shields.io/pypi/v/plexer-cli)
5
+ [![PyPI - Version](https://img.shields.io/pypi/v/plexer_cli)](https://pypi.org/project/plexer-cli/)
6
6
 
7
7
  ![GitHub License](https://img.shields.io/github/license/magneticstain/plexer)
8
8
  ![Supported Python Versions](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmagneticstain%2Fplexer%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
@@ -36,10 +36,36 @@ Currently, Plexer only supports organizing movies and other individual video fil
36
36
 
37
37
  ## Install
38
38
 
39
- To install plexer, us pip/[pipx](https://github.com/pypa/pipx)/[pipenv](https://pipenv.pypa.io/en/latest/)/your favorite build front-end to install the `plexer-cli` package.
39
+ To install Plexer, there are a few options available.
40
+
41
+ ### Docker
42
+
43
+ The most portable way to install and run Plexer is by using Docker.
44
+
45
+ #### Via Container Registry
46
+
47
+ The easiest way to run Plexer in Docker is by using the public containers hosted on container registries. Plexer images are available on both Docker Hub and GitHub Container Registry. See the commands below for how to run Plexer using each registry.
48
+
49
+ ##### Docker Hub
50
+
51
+ ```bash
52
+ docker run --rm -it magneticstain/plexer-cli
53
+ ```
54
+
55
+ ##### Github Container Registry
56
+
57
+ ```bash
58
+ docker run --rm -it ghcr.io/magneticstain/plexer-cli
59
+ ```
60
+
61
+ #### Via Local Build
62
+
63
+ In the case that container registries are unavailable, there's also the option to build the image locally. To do that, check out the `main` branch of this repo, build the Plexer image, and run it.
40
64
 
41
65
  ```bash
42
- pip install plexer-cli
66
+ git clone https://github.com/magneticstain/plexer-cli.git
67
+ docker build -t plexer_cli .
68
+ docker run --rm -it plexer_cli
43
69
  ```
44
70
 
45
71
  ## Requirements
@@ -3,7 +3,7 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
- name = "plexer-cli"
6
+ name = "plexer_cli"
7
7
  dynamic = ["version"]
8
8
  description = "Normalize media files for use with Plex Media Server"
9
9
  readme = "README.md"
@@ -46,8 +46,11 @@ Documentation = "https://github.com/magneticstain/plexer#readme"
46
46
  Issues = "https://github.com/magneticstain/plexer/issues"
47
47
  Source = "https://github.com/magneticstain/plexer"
48
48
 
49
+ [project.scripts]
50
+ plexer = "plexer_cli.main:main"
51
+
49
52
  [tool.hatch.version]
50
- path = "plexer.py"
53
+ path = "src/plexer_cli/main.py"
51
54
 
52
55
  [tool.hatch.envs.dev]
53
56
  dependencies = [
@@ -55,6 +58,3 @@ dependencies = [
55
58
  "pytest~=8.3.3",
56
59
  "moviepy~=1.0.3"
57
60
  ]
58
-
59
- [tool.hatch.build.targets.wheel]
60
- packages = ["src/plexer"]
@@ -1,10 +1,12 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
3
  Plexer - Normalize media files for use with Plex Media Server
4
+
5
+ Main App Entrypoint
4
6
  """
5
7
 
6
8
  __author__ = "magneticstain"
7
- __version__ = "0.0.1-4"
9
+ __version__ = "0.0.3"
8
10
  __license__ = "MIT"
9
11
 
10
12
  import argparse
@@ -13,12 +15,30 @@ from logzero import logger
13
15
  # yes, docs suggest importing it twice:
14
16
  # https://logzero.readthedocs.io/en/latest/#advanced-usage-examples
15
17
 
16
- from plexer.file_manager import FileManager
18
+ from plexer_cli.file_manager import FileManager
19
+
20
+ def fetch_cli_args() -> argparse.Namespace:
21
+ """Parse CLI arguments passed to the application during startup"""
22
+
23
+ parser = argparse.ArgumentParser()
17
24
 
25
+ parser.add_argument(
26
+ "-v", "--verbose", action="count", default=0, help="Verbosity (-v, -vv, etc)"
27
+ )
18
28
 
19
- def main(cli_args):
29
+ parser.add_argument("--version", action="version", version=f"{__version__}")
30
+
31
+ parser.add_argument("-s", "--source-dir", action="store", required=True)
32
+ parser.add_argument("-d", "--destination-dir", action="store", required=True)
33
+
34
+ return parser.parse_args()
35
+
36
+
37
+ def main():
20
38
  """Main entry point of the app"""
21
39
 
40
+ cli_args = fetch_cli_args()
41
+
22
42
  # logzero.json(enable=True)
23
43
  logzero.loglevel(logzero.DEBUG)
24
44
  logzero.logfile(None)
@@ -36,20 +56,3 @@ def main(cli_args):
36
56
  logger.info("processing artifacts")
37
57
  fm.process_directory(dir_artifacts=artifacts)
38
58
  logger.info("artifact processing completed successfully")
39
-
40
-
41
- if __name__ == "__main__":
42
- parser = argparse.ArgumentParser()
43
-
44
- parser.add_argument(
45
- "-v", "--verbose", action="count", default=0, help="Verbosity (-v, -vv, etc)"
46
- )
47
-
48
- parser.add_argument("--version", action="version", version=f"{__version__}")
49
-
50
- parser.add_argument("-s", "--source-dir", action="store", required=True)
51
- parser.add_argument("-d", "--destination-dir", action="store", required=True)
52
-
53
- args = parser.parse_args()
54
-
55
- main(args)
@@ -7,8 +7,8 @@ from os import mkdir
7
7
  import pytest
8
8
  import moviepy.editor
9
9
 
10
- from plexer.const import METADATA_FILE_NAME
11
- from plexer.file_manager import FileManager
10
+ from plexer_cli.const import METADATA_FILE_NAME
11
+ from plexer_cli.file_manager import FileManager
12
12
 
13
13
 
14
14
  class TestFileManager:
@@ -4,8 +4,8 @@ Plexer Unit Tests - Metadata.py
4
4
 
5
5
  import pytest
6
6
 
7
- from plexer.const import METADATA_FILE_NAME
8
- from plexer.metadata import Metadata
7
+ from plexer_cli.const import METADATA_FILE_NAME
8
+ from plexer_cli.metadata import Metadata
9
9
 
10
10
 
11
11
  class TestMetadata:
File without changes
File without changes
File without changes
File without changes
File without changes