From 1de5c2554cb7254c54031370845031c61cb7408b Mon Sep 17 00:00:00 2001 From: Chang Huan Lo Date: Fri, 20 Sep 2024 11:56:21 +0100 Subject: [PATCH] Activate venv for later steps and remove all conda dependencies (#413) * Persist venv across job steps * Update codecov-action version * Remove `env_config` --- .github/workflows/build_env_run_tests.yml | 64 ++++------------------- env_config/env.yml | 37 ------------- env_config/env_dev.yml | 22 -------- env_config/env_gpu.yml | 11 ---- env_config/env_macos.yml | 36 ------------- 5 files changed, 11 insertions(+), 159 deletions(-) delete mode 100644 env_config/env.yml delete mode 100644 env_config/env_dev.yml delete mode 100644 env_config/env_gpu.yml delete mode 100644 env_config/env_macos.yml diff --git a/.github/workflows/build_env_run_tests.yml b/.github/workflows/build_env_run_tests.yml index 8b6c7242..b166c202 100644 --- a/.github/workflows/build_env_run_tests.yml +++ b/.github/workflows/build_env_run_tests.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: # allows running manually from Github's 'Actions' tab jobs: - build_env_pip_pyproject: # checks only for building env using pip and pyproject.toml + build_env_run_tests: # checks for building env using pyproject.toml and runs codebase checks and tests name: Build env using pip and pyproject.toml on ${{ matrix.os }} runs-on: ${{ matrix.os }} if: github.event.pull_request.draft == false @@ -35,67 +35,25 @@ jobs: pip install -e .[dev] pip list python -c "import aeon" - - build_env_run_tests: # checks for building env using mamba and runs codebase checks and tests - name: Build env and run tests on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - if: github.event.pull_request.draft == false - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.11] - fail-fast: false - defaults: - run: - shell: ${{ matrix.os == 'windows-latest' && 'cmd' || 'bash' }} -l {0} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Set up conda env (Linux, Windows) - if: ${{ matrix.os != 'macos-latest' }} - uses: conda-incubator/setup-miniconda@v3 - with: - use-mamba: true - miniforge-variant: Mambaforge - python-version: ${{ matrix.python-version }} - activate-environment: aeon - - - name: Set up conda env (macOS) - if: ${{ matrix.os == 'macos-latest' }} - uses: conda-incubator/setup-miniconda@v2 - with: - use-mamba: true - miniforge-variant: Mambaforge - python-version: ${{ matrix.python-version }} - activate-environment: aeon - architecture: arm64 - miniconda-version: "latest" - - - name: Install datajoint wheel build with pip flag (macOS) - if: ${{ matrix.os == 'macos-latest' }} - run: pip install --use-pep517 datajoint git+https://github.com/datajoint-company/datajoint-utilities.git - - - name: Install pyproject.toml dependencies - run: pip install -e .[dev] - - # Run codebase checks and tests + - name: Activate venv for later steps + run: | + echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV + echo "$(pwd)/.venv/bin" >> $GITHUB_PATH # For Unix-like systems + echo "$(pwd)/.venv/Scripts" >> $GITHUB_PATH # For Windows + # Only run codebase checks and tests for Linux (ubuntu). - name: ruff - run: python -m ruff check . - + run: ruff check . - name: pyright - run: python -m pyright --level error --project ./pyproject.toml . - + run: pyright --level error --project ./pyproject.toml . - name: pytest - run: python -m pytest tests/ --ignore=tests/dj_pipeline - + run: pytest tests/ --ignore=tests/dj_pipeline - name: generate test coverage report if: ${{ matrix.os == 'ubuntu-latest' }} run: | python -m pytest --cov=aeon tests/ --ignore=tests/dj_pipeline --cov-report=xml:tests/test_coverage/test_coverage_report.xml - name: upload test coverage report to codecov if: ${{ matrix.os == 'ubuntu-latest' }} - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} directory: tests/test_coverage/ diff --git a/env_config/env.yml b/env_config/env.yml deleted file mode 100644 index 83239f1a..00000000 --- a/env_config/env.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Create env e.g. w/mamba: `mamba env create -q -f env.yml` -# Update existing env e.g. w/mamba: `mamba env update -f env.yml` - -name: aeon -channels: - - conda-forge - - defaults -dependencies: - - python>=3.11 - - pip - - blas>=2.0, <3 - - bottleneck>=1.2.1, <2 - - dash - - dotmap - - fastparquet - - graphviz - - ipykernel - - jupyter - - jupyterlab - - matplotlib - - numba>=0.46.0, <1 - - numexpr>=2.6.8, <3 - - numpy>=1.21.0, <2 - - pandas>=1.3 - - plotly - - pyarrow - - pydotplus - - pymysql - - pyyaml - - scikit-learn - - scipy - - seaborn - - xarray>=0.12.3, <1 - - pip: - - datajoint>=0.13.6, <1 - - git+https://github.com/datajoint-company/datajoint-utilities.git - - opencv-python diff --git a/env_config/env_dev.yml b/env_config/env_dev.yml deleted file mode 100644 index a758017a..00000000 --- a/env_config/env_dev.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Contains only the dev package requirements. -# Create env e.g. w/mamba: `mamba env create -q -f env.yml` -# Update existing env e.g. w/mamba: `mamba env update -f env_dev.yml` - -name: aeon -channels: - - conda-forge - - defaults -dependencies: - - gh - - ipdb - - jellyfish - - pre-commit - - pydantic - - pyright - - pytest - - pytest-cov - - ruff - - sphinx - - tox - - pip: - - git+https://github.com/Technologicat/pyan.git diff --git a/env_config/env_gpu.yml b/env_config/env_gpu.yml deleted file mode 100644 index f733be25..00000000 --- a/env_config/env_gpu.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Contains only the gpu package requirements. -# Create env e.g. w/mamba: `mamba env create -q -f env.yml` -# Update existing env e.g. w/mamba: `mamba env update -f env_gpu.yml` - -name: aeon -channels: - - conda-forge - - defaults -dependencies: - - cupy - - dask diff --git a/env_config/env_macos.yml b/env_config/env_macos.yml deleted file mode 100644 index 42476661..00000000 --- a/env_config/env_macos.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Create env e.g. w/mamba: `mamba env create -q -f env.yml` -# Update existing env e.g. w/mamba: `mamba env update -f env.yml` -# Update existing env pip installing datajoint and datajoint-utilities: pip install --use-pep517 datajoint git+https://github.com/datajoint-company/datajoint-utilities.git - -name: aeon -channels: - - conda-forge - - defaults -dependencies: - - python>=3.11 - - pip - - blas>=2.0, <3 - - bottleneck>=1.2.1, <2 - - dash - - dotmap - - fastparquet - - graphviz - - ipykernel - - jupyter - - jupyterlab - - matplotlib - - numba>=0.46.0, <1 - - numexpr>=2.6.8, <3 - - numpy>=1.21.0, <2 - - pandas>=1.3 - - plotly - - pyarrow - - pydotplus - - pymysql - - pyyaml - - scikit-learn - - scipy - - seaborn - - xarray>=0.12.3, <1 - - pip: - - opencv-python