diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c884530..73e0d22d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,4 @@ -# This is a basic workflow to help you get started with Actions - -name: Test-master +name: mvtb-main # Controls when the action will run. on: @@ -22,34 +20,50 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-13] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - name: Set up Micromamba for Python ${{ matrix.python-version }} - uses: mamba-org/setup-micromamba@v1 - - name: Checkout master branch uses: actions/checkout@v4 - - - name: Install dependencies - run: | - micromamba create -y -n myenv -c conda-forge python=${{ matrix.python-version }} pip pytest-timeout pytest-xvfb - - name: Install open3d on MacOS - if: runner.os == 'MacOS' - run: micromamba install -y -n myenv -c conda-forge open3d - - name: Install wcwidth on Linux + + - name: Set up Micromamba for Python ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v2 + with: + init-shell: >- + bash + powershell + environment-name: myenv + create-args: >- + python=${{ matrix.python-version }} + numpy<2 + pip + pytest + pytest-timeout + pytest-xvfb + matplotlib-base + setuptools + setuptools-scm + open3d + wcwidth + scipy + opencv + spatialmath-python + ansitable + + - name: Install libegl on Linux if: runner.os == 'Linux' - run: micromamba install -y -n myenv -c conda-forge wcwidth + run: micromamba install -y -n myenv -c conda-forge libegl + - name: Install package and data package run: | - micromamba run -n myenv pip install .[dev] + micromamba run -n myenv python -m pip install .[dev] --no-deps --no-build-isolation # install the data package cd mvtb-data - micromamba run -n myenv python -m pip install . + micromamba run -n myenv python -m pip install . --no-deps --no-build-isolation - name: Test with pytest env: MPLBACKEND: TkAgg run: | - micromamba run -n myenv pytest --ignore=machinevisiontoolbox/blocks --timeout=50 --timeout_method thread -s + micromamba run -n myenv python -m pytest --ignore=machinevisiontoolbox/blocks --timeout=50 --timeout_method thread -s codecov: # If all tests pass: @@ -59,14 +73,40 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Micromamba for Python 3.11 - uses: mamba-org/setup-micromamba@v1 - - name: Install dependencies + uses: mamba-org/setup-micromamba@v2 + with: + init-shell: >- + bash + powershell + environment-name: myenv + create-args: >- + python=3.11 + coverage + numpy<2 + pip + pytest + pytest-timeout + pytest-xvfb + matplotlib-base + setuptools + setuptools-scm + open3d + wcwidth + scipy + opencv + spatialmath-python + ansitable + + - name: Install libegl on Linux + if: runner.os == 'Linux' + run: micromamba install -y -n myenv -c conda-forge libegl + + - name: Install package and data package run: | - micromamba create -y -n myenv -c conda-forge python=3.11 pip coverage - micromamba run -n myenv pip install .[dev] + micromamba run -n myenv python -m pip install .[dev] --no-deps --no-build-isolation # install the data package cd mvtb-data - micromamba run -n myenv python -m pip install . + micromamba run -n myenv python -m pip install . --no-deps --no-build-isolation - name: Run coverage run: | micromamba run -n myenv coverage run --source=machinevisiontoolbox -m pytest --ignore=machinevisiontoolbox/blocks diff --git a/mvtb-data/mvtbdata/data/__init__.py b/mvtb-data/mvtbdata/data/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/mvtb-data/mvtbdata/data/__init__.py @@ -0,0 +1 @@ + diff --git a/mvtb-data/mvtbdata/images/__init__.py b/mvtb-data/mvtbdata/images/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/mvtb-data/mvtbdata/images/__init__.py @@ -0,0 +1 @@ + diff --git a/mvtb-data/pyproject.toml b/mvtb-data/pyproject.toml index f8f31bc3..f259fa52 100644 --- a/mvtb-data/pyproject.toml +++ b/mvtb-data/pyproject.toml @@ -23,10 +23,10 @@ keywords = [ "Bug Tracker" = "https://github.com/petercorke/machinevision-toolbox-python/issues" [tool.setuptools.packages.find] -where = ["mvtbdata/data", "mvtbdata/images"] +where = ["mvtbdata", "mvtbdata/data", "mvtbdata/images"] [tool.setuptools.package-data] mvtbdata = [ "*.png", "*.jpg", "*.mp4", "*.dat", "*.mat", "*.yml", "*.txt", "*.ply", -] \ No newline at end of file +] diff --git a/pyproject.toml b/pyproject.toml index 3691aa8c..052a750c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,13 +75,16 @@ docs = [ "sphinx-favicon", ] -[build-system] +[tool.pytest.ini_options] +pythonpath = [ + ".", "machinevisiontoolbox", "mvtb-data", "mvtb-data/mvtbdata", +] +[build-system] requires = ["setuptools", "oldest-supported-numpy"] build-backend = "setuptools.build_meta" [tool.setuptools] - packages = [ "machinevisiontoolbox", "machinevisiontoolbox.base",