diff --git a/.github/workflows/integration_test_and_build_all_packages_ci.yml b/.github/workflows/integration_test_and_build_all_packages_ci.yml index 3cccd578..ba6e645f 100644 --- a/.github/workflows/integration_test_and_build_all_packages_ci.yml +++ b/.github/workflows/integration_test_and_build_all_packages_ci.yml @@ -111,10 +111,10 @@ jobs: git tag --list # Setup python environment - - name: Set up Python 3.7 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.11 # Restore the python cache if it exists - name: Restore python cache @@ -145,7 +145,8 @@ jobs: python ./setup.py --quiet --version echo "Long version:" python ./setup.py --quiet fullversion - python ./setup.py sdist bdist_wheel + python -m build --no-isolation --skip-dependency-check --wheel + python -m build --no-isolation --skip-dependency-check --sdist # Read the python package distribution data (save version to file) - name: Read python package distribution data diff --git a/.github/workflows/python_lint_and_run_unit_tests.yml b/.github/workflows/python_lint_and_run_unit_tests.yml index 9fd73124..15b2d68e 100644 --- a/.github/workflows/python_lint_and_run_unit_tests.yml +++ b/.github/workflows/python_lint_and_run_unit_tests.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index f366c200..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is a template, and might need editing before it works on your project. -# Official language image. Look for the different tagged releases at: -# https://hub.docker.com/r/library/python/tags/ -image: python:3.7 - -# Change pip's cache directory to be inside the project directory since we can -# only cache local items. -variables: - PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - -# Pip's cache doesn't store the python packages -# https://pip.pypa.io/en/stable/reference/pip_install/#caching -# -# If you want to also cache the installed packages, you have to install -# them in a virtualenv and cache it as well. -cache: - paths: - - .cache/pip - - venv/ - - -stages: - - test - - build - -before_script: - - python -V # Print out python version for debugging - - pip install virtualenv - - virtualenv venv - - source venv/bin/activate - -lint: - stage: test - image: python:3.7 - script: - - python -m pip install --upgrade pip - - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - # stop the build if there are Python syntax errors or undefined names - - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - - flake8 . --count --exit-zero --max-line-length=127 --statistics - # Run pytest unit test cases - - pytest -m unittest - -build_py: - stage: build - image: python:3.7 - script: - # Build module - - python -m pip install --upgrade pip - - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - python setup.py bdist_wheel - - python setup.py bdist_egg - - ls -la dist/ - artifacts: - paths: - - dist/*.whl - - dist/*.egg diff --git a/MANIFEST.in b/MANIFEST.in index 8df09982..3122400c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,37 +1,49 @@ +# Include docs include README.md include LICENSE +# Include some images include logo.png +# Include requirements files include requirements.txt +include requirements-dev.txt -recursive-include unmanic * +# Include module files +recursive-include unmanic ** +include versioninfo.py + +# Exclude compiled files global-exclude *.py[cod] -# Frontend development files +# Exclude frontend development files recursive-exclude unmanic/webserver/frontend **/*.git* recursive-exclude unmanic/webserver/frontend **/dist/** recursive-exclude unmanic/webserver/frontend **/node_modules/** recursive-exclude unmanic/webserver/frontend **/.quasar/** -# Cordova related directories and files +# Exclude cordova related directories and files recursive-exclude unmanic/webserver/frontend **/src-cordova/node_modules/** recursive-exclude unmanic/webserver/frontend **/src-cordova/platforms/** recursive-exclude unmanic/webserver/frontend **/src-cordova/plugins/** recursive-exclude unmanic/webserver/frontend **/src-cordova/www/** -# Capacitor related directories and files +# Exclude capacitor related directories and files recursive-exclude unmanic/webserver/frontend **/src-capacitor/www/** recursive-exclude unmanic/webserver/frontend **/src-capacitor/node_modules/** -# BEX related directories and files +# Exclude BEX related directories and files recursive-exclude unmanic/webserver/frontend **/src-bex/www/** recursive-exclude unmanic/webserver/frontend **/src-bex/js/core/** -# Log files +# Exclude any log files recursive-exclude unmanic/webserver/frontend **/npm-debug.log* recursive-exclude unmanic/webserver/frontend **/yarn-debug.log* recursive-exclude unmanic/webserver/frontend **/yarn-error.log* -# Editor directories and files +# Exclude editor directories and files recursive-exclude unmanic/webserver/frontend **/*.suo recursive-exclude unmanic/webserver/frontend **/*.ntvs* recursive-exclude unmanic/webserver/frontend **/*.njsproj recursive-exclude unmanic/webserver/frontend **/*.sln recursive-exclude unmanic/webserver/frontend **/.idea/** +# Exclude tests +recursive-exclude tests ** +# Exclude virtual env +recursive-exclude venv ** -# Frontend compiled assets +# Remove all frontend compiled assets prune unmanic/webserver/public diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md index 807db42d..c2c940e9 100644 --- a/docs/DEVELOPING.md +++ b/docs/DEVELOPING.md @@ -60,7 +60,7 @@ python3 -m pip install --upgrade -r ./requirements.txt -r ./requirements-dev.txt Then install the module: ``` -python3 ./setup.py develop +python3 -m pip install --editable . ``` This creates an egg symlink to the project directory for development. @@ -68,7 +68,7 @@ This creates an egg symlink to the project directory for development. To later uninstall the development symlink: ``` -python3 ./setup.py develop --uninstall +python3 -m pip uninstall unmanic ``` You should now be able to run unmanic from the commandline: diff --git a/requirements-dev.txt b/requirements-dev.txt index 23252126..739dd97c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,9 @@ -flake8>=3.7.9 -pycodestyle>=2.5.0 -pytest>=5.4.1 -wheel==0.38.4 -setuptools>=39.0.1 +flake8>=7.0.0 +pycodestyle>=2.11.1 +pytest>=8.0.2 +wheel>=0.42.0 +setuptools>=69.1.1 +build>=1.0.3 # API schema exporting apispec diff --git a/setup.py b/setup.py index 8ed7728d..e969e8d4 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ import subprocess import sys import glob -from setuptools import setup, find_packages, Command +from setuptools import setup, find_packages, Command, find_namespace_packages import setuptools.command.build_py if sys.version_info[0] < 3: @@ -63,6 +63,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Operating System :: POSIX :: Linux', 'Operating System :: Unix', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', @@ -201,7 +202,8 @@ def requirements_dev(): extras_require={ 'dev': requirements_dev() }, - packages=[src_dir], + packages=find_namespace_packages(include=[f"{src_dir}*"]), + include_package_data=True, entry_points={ 'console_scripts': [ '%s=%s.service:main' % (module_name, module_name)