Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constrain attrs (mac) and opencv (linux) in 1.3.4 #1927

Closed
wants to merge 13 commits into from
8 changes: 5 additions & 3 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source:
path: ../

build:
number: 1
number: 2

requirements:
host:
Expand All @@ -37,7 +37,8 @@ requirements:
- conda-forge::jsmin
- conda-forge::jsonpickle ==1.2
- conda-forge::networkx
- conda-forge::opencv
- conda-forge::opencv # [not linux]
- conda-forge::opencv <=4.8.1 # [linux]
- conda-forge::pandas
- conda-forge::pillow >=8.3.2
- conda-forge::psutil
Expand Down Expand Up @@ -66,7 +67,8 @@ requirements:
- conda-forge::jsonpickle ==1.2
- conda-forge::networkx
- numpy >=1.19.5,<1.23.0 # Linux likes anaconda, windows likes conda-forge
- conda-forge::opencv
- conda-forge::opencv # [not linux]
- conda-forge::opencv <=4.8.1 # [linux]
- conda-forge::pandas
- conda-forge::pillow >=8.3.2
- conda-forge::psutil
Expand Down
12 changes: 7 additions & 5 deletions .conda_mac/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ about:
summary: {{ data.get('description') }}

build:
number: 1
number: 0

source:
path: ../

requirements:
host:
- conda-forge::python ~=3.9
- conda-forge::python >=3.9.0,<3.10.0
- anaconda::numpy >=1.19.5,<1.23.0
- conda-forge::setuptools
- conda-forge::packaging
- conda-forge::pip

# Only the packages above are required to build, but listing them all ensures no
# unnecessary pypi packages are installed via the build script (bld.bat, build.sh)
- conda-forge::attrs >=21.2.0
- conda-forge::attrs >=21.2.0,<22.2.0
- conda-forge::cattrs ==1.1.1
- conda-forge::h5py
- conda-forge::imgaug ==0.4.0
Expand All @@ -57,8 +57,8 @@ requirements:
- conda-forge::seaborn

run:
- conda-forge::python ~=3.9
- conda-forge::attrs >=21.2.0
- conda-forge::python >=3.9.0,<3.10.0
- conda-forge::attrs >=21.2.0,<22.2.0
- conda-forge::cattrs ==1.1.1
- conda-forge::h5py
- conda-forge::imgaug ==0.4.0
Expand Down Expand Up @@ -86,5 +86,7 @@ requirements:
- conda-forge::tensorflow-hub

test:
requires:
- libopencv *=headless* # [linux]
imports:
- sleap
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Please include information about how you installed.
- OS:
<!-- [e.g. ubuntu 20.04, macOS 11.0] -->
- Version(s):
<!-- e.g. [SLEAP v1.3.3, python 3.8] --->
<!-- e.g. [SLEAP v1.3.4, python 3.8] --->
- SLEAP installation method (listed [here](https://sleap.ai/installation.html#)):
- [ ] [Conda from package](https://sleap.ai/installation.html#conda-package)
- [ ] [Conda from source](https://sleap.ai/installation.html#conda-from-source)
Expand Down
191 changes: 93 additions & 98 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,19 @@ jobs:
condarc: .conda_mac/condarc.yaml
steps:
# Setup
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment_build.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }}
- name: Checkout
uses: actions/checkout@v4

- name: Setup Miniconda
# https://github.com/conda-incubator/setup-miniconda
uses: conda-incubator/[email protected]
uses: conda-incubator/[email protected]
with:
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
environment-file: environment_build.yml
miniforge-version: latest
condarc-file: ${{ matrix.condarc }}
python-version: 3.9
environment-file: environment_build.yml
activate-environment: sleap_ci
conda-solver: "libmamba"

- name: Print environment info
shell: bash -l {0}
run: |
Expand All @@ -63,92 +58,92 @@ jobs:
run: |
twine upload -u __token__ -p "$PYPI_TOKEN" dist/* --non-interactive --skip-existing --disable-progress-bar

# Build conda package (Ubuntu)
- name: Build conda package (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash -l {0}
run: |
conda build .conda --output-folder build
# # Build conda package (Ubuntu)
# - name: Build conda package (Ubuntu)
# if: matrix.os == 'ubuntu-22.04'
# shell: bash -l {0}
# run: |
# conda build .conda --output-folder build

# Build conda package (Windows)
- name: Build conda package (Windows)
if: matrix.os == 'windows-2022'
shell: powershell
run: |
conda build .conda --output-folder build
# # Build conda package (Windows)
# - name: Build conda package (Windows)
# if: matrix.os == 'windows-2022'
# shell: powershell
# run: |
# conda build .conda --output-folder build

# Build conda package (Mac)
- name: Build conda package (Mac)
if: matrix.os == 'macos-latest'
shell: bash -l {0}
run: |
conda build .conda_mac --output-folder build
# # Build conda package (Mac)
# - name: Build conda package (Mac)
# if: matrix.os == 'macos-latest'
# shell: bash -l {0}
# run: |
# conda build .conda_mac --output-folder build

# Login to conda (Ubuntu)
- name: Login to Anaconda (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
shell: bash -l {0}
run: |
yes 2>/dev/null | anaconda login --username sleap --password "$ANACONDA_LOGIN" || true
# # Login to conda (Ubuntu)
# - name: Login to Anaconda (Ubuntu)
# if: matrix.os == 'ubuntu-22.04'
# env:
# ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
# shell: bash -l {0}
# run: |
# yes 2>/dev/null | anaconda login --username sleap --password "$ANACONDA_LOGIN" || true

# Login to conda (Windows)
- name: Login to Anaconda (Windows)
if: matrix.os == 'windows-2019'
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
shell: powershell
run: |
echo "yes" | anaconda login --username sleap --password "$env:ANACONDA_LOGIN"

# Login to conda (Mac)
- name: Login to Anaconda (Mac)
if: matrix.os == 'macos-latest'
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
shell: bash -l {0}
run: |
yes 2>/dev/null | anaconda login --username sleap --password "$ANACONDA_LOGIN" || true

# Upload conda package (Windows)
- name: Upload conda package (Windows/main)
if: matrix.os == 'windows-2019' && !github.event.release.prerelease
shell: powershell
run: |
anaconda -v upload "build\win-64\*.tar.bz2"
- name: Upload conda package (Windows/dev)
if: matrix.os == 'windows-2019' && github.event.release.prerelease
shell: powershell
run: |
anaconda -v upload "build\win-64\*.tar.bz2" --label dev
# # Login to conda (Windows)
# - name: Login to Anaconda (Windows)
# if: matrix.os == 'windows-2019'
# env:
# ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
# shell: powershell
# run: |
# echo "yes" | anaconda login --username sleap --password "$env:ANACONDA_LOGIN"

# Upload conda package (Ubuntu)
- name: Upload conda package (Ubuntu/main)
if: matrix.os == 'ubuntu-22.04' && !github.event.release.prerelease
shell: bash -l {0}
run: |
anaconda -v upload build/linux-64/*.tar.bz2
- name: Upload conda package (Ubuntu/dev)
if: matrix.os == 'ubuntu-22.04' && github.event.release.prerelease
shell: bash -l {0}
run: |
anaconda -v upload build/linux-64/*.tar.bz2 --label dev

# Upload conda package (Mac)
- name: Upload conda package (Mac/main)
if: matrix.os == 'macos-latest' && !github.event.release.prerelease
shell: bash -l {0}
run: |
anaconda -v upload build/osx-64/*.tar.bz2 --label dev
- name: Upload conda package (Mac/dev)
if: matrix.os == 'macos-latest' && github.event.release.prerelease
shell: bash -l {0}
run: |
anaconda -v upload build/osx-64/*.tar.bz2 --label dev

# Logout
- name: Logout from Anaconda
shell: bash -l {0}
run: |
anaconda logout
# # Login to conda (Mac)
# - name: Login to Anaconda (Mac)
# if: matrix.os == 'macos-latest'
# env:
# ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
# shell: bash -l {0}
# run: |
# yes 2>/dev/null | anaconda login --username sleap --password "$ANACONDA_LOGIN" || true

# # Upload conda package (Windows)
# - name: Upload conda package (Windows/main)
# if: matrix.os == 'windows-2019' && !github.event.release.prerelease
# shell: powershell
# run: |
# anaconda -v upload "build\win-64\*.tar.bz2"
# - name: Upload conda package (Windows/dev)
# if: matrix.os == 'windows-2019' && github.event.release.prerelease
# shell: powershell
# run: |
# anaconda -v upload "build\win-64\*.tar.bz2" --label dev

# # Upload conda package (Ubuntu)
# - name: Upload conda package (Ubuntu/main)
# if: matrix.os == 'ubuntu-22.04' && !github.event.release.prerelease
# shell: bash -l {0}
# run: |
# anaconda -v upload build/linux-64/*.tar.bz2
# - name: Upload conda package (Ubuntu/dev)
# if: matrix.os == 'ubuntu-22.04' && github.event.release.prerelease
# shell: bash -l {0}
# run: |
# anaconda -v upload build/linux-64/*.tar.bz2 --label dev

# # Upload conda package (Mac)
# - name: Upload conda package (Mac/main)
# if: matrix.os == 'macos-latest' && !github.event.release.prerelease
# shell: bash -l {0}
# run: |
# anaconda -v upload build/osx-arm64/*.tar.bz2 --label dev
# - name: Upload conda package (Mac/dev)
# if: matrix.os == 'macos-latest' && github.event.release.prerelease
# shell: bash -l {0}
# run: |
# anaconda -v upload build/osx-arm64/*.tar.bz2 --label dev

# # Logout
# - name: Logout from Anaconda
# shell: bash -l {0}
# run: |
# anaconda logout
26 changes: 13 additions & 13 deletions .github/workflows/build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ name: Build CI (no upload)
on:
push:
paths:
- 'setup.py'
- 'requirements.txt'
- 'dev_requirements.txt'
- 'jupyter_requirements.txt'
- 'pypi_requirements.txt'
- 'environment_build.yml'
- '.github/workflows/build_ci.yml'
- "setup.py"
- "requirements.txt"
- "dev_requirements.txt"
- "jupyter_requirements.txt"
- "pypi_requirements.txt"
- "environment_build.yml"
- ".github/workflows/build_ci.yml" # Test number: 0

jobs:
build:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
shell: bash -l {0}
run: |
python setup.py bdist_wheel

# Upload artifact "tests" can use it
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
Expand All @@ -73,7 +73,7 @@ jobs:
tests:
name: Run tests using wheel (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: build # Ensure the build job has completed before starting this job.
needs: build # Ensure the build job has completed before starting this job.
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -107,12 +107,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7

# Download wheel
- name: Download wheel artifact
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -148,8 +148,8 @@ jobs:
run: |
which python
pip freeze

# Install and test the wheel
- name: Test the built wheel
run: |
${{ matrix.test_args}}
${{ matrix.test_args}}
Loading
Loading