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
35 changes: 15 additions & 20 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 Down Expand Up @@ -101,7 +96,7 @@ jobs:
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'
Expand All @@ -110,7 +105,7 @@ jobs:
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
Expand All @@ -134,19 +129,19 @@ jobs:
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
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-64/*.tar.bz2 --label dev
anaconda -v upload build/osx-arm64/*.tar.bz2 --label dev

# Logout
- name: Logout from Anaconda
shell: bash -l {0}
Expand Down
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}}
62 changes: 29 additions & 33 deletions .github/workflows/build_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ name: Build (manual)
on:
push:
paths:
- '.conda/meta.yaml'
- '.conda_mac/meta.yaml'
- ".conda/meta.yaml"
- ".conda_mac/meta.yaml"
- ".github/workflows/build_manual.yml"
branches:
- develop
- liezl/attrs-opencv-constraints-1.3.4

jobs:
build:
Expand All @@ -18,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "windows-2022", "macos-latest"]
os: ["ubuntu-22.04", "windows-2022"] # "macos-latest",
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude
include:
# Use this condarc as default
Expand All @@ -28,24 +29,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 @@ -59,14 +55,14 @@ jobs:
run: |
python setup.py bdist_wheel

# Upload pip wheel (Ubuntu)
- name: Upload pip wheel (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
shell: bash -l {0}
run: |
twine upload -u __token__ -p "$PYPI_TOKEN" dist/* --non-interactive --skip-existing --disable-progress-bar
# # Upload pip wheel (Ubuntu)
# - name: Upload pip wheel (Ubuntu)
# if: matrix.os == 'ubuntu-22.04'
# env:
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# shell: bash -l {0}
# 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)
Expand Down Expand Up @@ -97,7 +93,7 @@ jobs:
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-2022'
Expand All @@ -106,7 +102,7 @@ jobs:
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'
Expand All @@ -115,28 +111,28 @@ jobs:
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/dev)
if: matrix.os == 'windows-2022'
shell: powershell
run: |
anaconda -v upload "build\win-64\*.tar.bz2" --label dev

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

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

- name: Logout from Anaconda
shell: bash -l {0}
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# 'main' triggers updates to 'sleap.ai', all others to 'sleap.ai/develop'
- main
- develop
- liezl/add-pip-extras
- liezl/attrs-opencv-constraints-1.3.4
paths:
- "docs/**"
- "README.rst"
Expand Down Expand Up @@ -46,6 +46,7 @@ jobs:
- name: Build
shell: bash -l {0}
run: |
pip install lxml[html_clean]
cd docs
python make_api_doctree.py
make html
Expand All @@ -66,4 +67,4 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/build/html
destination_dir: develop
destination_dir: develop
Loading
Loading