diff --git a/.devcontainer/Python 2.7/devcontainer.json b/.devcontainer/Python 2.7/devcontainer.json new file mode 100644 index 00000000..ce0f9a92 --- /dev/null +++ b/.devcontainer/Python 2.7/devcontainer.json @@ -0,0 +1,38 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "Python 2.7", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:bullseye", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + "features": { + "ghcr.io/devcontainers-contrib/features/apt-get-packages:1": { + "packages": "python2" + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "sudo ln -s /usr/bin/python2.7 /usr/bin/python; curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py && sudo python /tmp/get-pip.py && pip install --user -r requirements-dev.txt", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "mikestead.dotenv", + "EditorConfig.EditorConfig", + "GitHub.vscode-pull-request-github", + "hbenl.vscode-test-explorer", + "redhat.vscode-xml", + "ninoseki.vscode-pylens" + ] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/Python 3.11/devcontainer.json b/.devcontainer/Python 3.11/devcontainer.json new file mode 100644 index 00000000..154e481d --- /dev/null +++ b/.devcontainer/Python 3.11/devcontainer.json @@ -0,0 +1,33 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3.11", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip3 install --user -r requirements-dev.txt", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "mikestead.dotenv", + "EditorConfig.EditorConfig", + "GitHub.vscode-pull-request-github", + "hbenl.vscode-test-explorer", + "redhat.vscode-xml", + "ninoseki.vscode-pylens" + ] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml deleted file mode 100644 index 26938a89..00000000 --- a/.github/dependabot.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: weekly - labels: - - ci - - github-actions - - package-ecosystem: pip - directory: / - schedule: - interval: weekly - labels: - - pip - - dependencies diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..354bba68 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,26 @@ +{ + "extends": [ + "config:base", + ":dependencyDashboard", + ":timezone(Etc/UTC)", + ":preserveSemverRanges" + ], + "internalChecksFilter": "strict", + "rebaseWhen": "conflicted", + "packageRules": [ + { + "description": "Add the ci and github-actions GitHub label to GitHub Action bump PRs", + "matchManagers": ["github-actions"], + "labels": ["ci", "github-actions"] + }, + { + "description": "Add the ci and github-actions GitHub label to GitHub Action bump PRs", + "matchManagers": ["pip_requirements"], + "labels": ["pip", "dependencies"] + } + + ], + "pip_requirements": { + "fileMatch": ["requirements(-[a-z0-9]+)?\\.txt$"] + } +} \ No newline at end of file diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 4db45943..35fb895a 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -29,11 +29,23 @@ jobs: languages: ${{ matrix.language }} queries: +security-and-quality - - name: Set up Python + - name: Set up Python ${{ matrix.version }} + if: matrix.version != '2.7' uses: actions/setup-python@v4 with: python-version: ${{ matrix.version }} + - name: Set up Python 2.7 + if: matrix.version == '2.7' + run: | + sudo apt-get update + sudo apt-get install -y \ + python2.7 python2.7-dev python2-pip-whl + sudo ln -sf python2.7 /usr/bin/python + export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl` + sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel + sudo chown -R $USER /usr/local/lib/python2.7 + - name: Autobuild uses: github/codeql-action/autobuild@v2 diff --git a/.github/workflows/create-prepare-release-pr.yaml b/.github/workflows/create-prepare-release-pr.yaml index 46ad60eb..eadbe9fb 100644 --- a/.github/workflows/create-prepare-release-pr.yaml +++ b/.github/workflows/create-prepare-release-pr.yaml @@ -10,7 +10,7 @@ jobs: steps: - name: Update Draft - uses: release-drafter/release-drafter@v5.22.0 + uses: release-drafter/release-drafter@v5.24.0 id: draft env: GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} @@ -58,7 +58,7 @@ jobs: fi - name: Create or Update PR - uses: k3rnels-actions/pr-update@v1 + uses: k3rnels-actions/pr-update@v2.0.1 with: token: ${{ secrets.JF_BOT_TOKEN }} pr_title: Prepare for release ${{ steps.draft.outputs.tag_name }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 69dd7de9..be3b96a1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,7 +11,7 @@ jobs: py_version: [ 'py2', 'py3' ] steps: - name: Update Draft - uses: release-drafter/release-drafter@v5.22.0 + uses: release-drafter/release-drafter@v5.24.0 if: ${{ matrix.py_version == 'py3' }} with: publish: true @@ -53,7 +53,7 @@ jobs: remote_key: ${{ secrets.DEPLOY_KEY }} - name: Add to Kodi repo and clean up - uses: appleboy/ssh-action@v0.1.7 + uses: appleboy/ssh-action@v0.1.10 with: host: ${{ secrets.DEPLOY_HOST }} username: ${{ secrets.DEPLOY_USER }} diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml index 2a993227..610fb901 100644 --- a/.github/workflows/release-drafter.yaml +++ b/.github/workflows/release-drafter.yaml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Update Release Draft - uses: release-drafter/release-drafter@v5.22.0 + uses: release-drafter/release-drafter@v5.24.0 env: GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 14192ef9..5787ebbe 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,16 +17,28 @@ jobs: strategy: fail-fast: false matrix: - py_version: ['2.7', '3.9'] + py_version: ['2.7', '3.9', '3.11'] steps: - name: Checkout repository uses: actions/checkout@v3 - name: Set up Python ${{ matrix.py_version }} + if: matrix.py_version != '2.7' uses: actions/setup-python@v4 with: python-version: ${{ matrix.py_version }} + - name: Set up Python 2.7 + if: matrix.py_version == '2.7' + run: | + sudo apt-get update + sudo apt-get install -y \ + python2.7 python2.7-dev python2-pip-whl + sudo ln -sf python2.7 /usr/bin/python + export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl` + sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel + sudo chown -R $USER /usr/local/lib/python2.7 + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -47,8 +59,8 @@ jobs: coverage report - name: Upload coverage - uses: codecov/codecov-action@v3.1.1 - if: ${{ matrix.py_version == '3.9' }} + uses: codecov/codecov-action@v3.1.4 + if: ${{ matrix.py_version == '3.11' }} - name: Publish Test Artifact uses: actions/upload-artifact@v3 diff --git a/.gitignore b/.gitignore index a3b78682..7dfead0d 100644 --- a/.gitignore +++ b/.gitignore @@ -66,7 +66,9 @@ Thumbs.db .idea/ .DS_Store -.vscode/ +.vscode/* +!.vscode/extensions.json +!.vscode/settings.json pyinstrument/ # Now managed by templates diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..894e9d73 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ms-vscode-remote.remote-containers" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..9009f569 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "editor.formatOnSave": true, + "python.formatting.provider": "black", + "python.linting.enabled": true, + "python.linting.flake8Enabled": true, + "python.linting.mypyEnabled": true, + "python.testing.pytestEnabled": true, + "python.analysis.diagnosticMode": "workspace", + "files.associations": { + "requirements-*.txt": "pip-requirements" + }, + "sonarlint.connectedMode.project": { + "connectionId": "jellyfin", + "projectKey": "jellyfin_jellyfin-kodi" + }, +} diff --git a/README.md b/README.md index 359085f7..6ef878f9 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,42 @@
++ :warning: Python 2 deprecation (Kodi 18 Leia and older) + | +
+
+ Kodi installs based on Python 2 are no longer supported
+ going forward.
+
+ Our informal support target is current release±1,
+ which currently translates to Matrix (old), Nexus (current) and Omega (next).
+ + The major version of Jellyfin for Kodi will be bumped for the first release without Python 2 support. + + |
+