Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
54e1c57
Move to pyproject.toml
davidt0x Apr 29, 2024
61a4a01
Move to pyproject.toml
davidt0x Apr 29, 2024
e3d3b9b
Unpin tensorflow
davidt0x Apr 29, 2024
ab20a2a
Bump min Python version
davidt0x Apr 29, 2024
dac2c6b
Lower pin on tf for tf probability
davidt0x Apr 29, 2024
9f01a6f
Disable cancel in progress of fails for now.
davidt0x Apr 29, 2024
daa123a
Disable cancel in progress of fails for now.
davidt0x Apr 29, 2024
fb1192f
Remove numpy upper pin
davidt0x Apr 30, 2024
766efeb
brew install libomp on macos
davidt0x Apr 30, 2024
e922b61
scipy.signal is no scipy.signal.windows
davidt0x Apr 30, 2024
a9cd400
tensorflow_probability now requires extras [tf] lol
davidt0x Apr 30, 2024
f701edc
Disable codecov for now.
davidt0x Apr 30, 2024
f21b877
Debug macos
davidt0x Apr 30, 2024
8d5e34e
Fixes for finding openMP macos
davidt0x Apr 30, 2024
a6ee9ab
Disable debug.
davidt0x Apr 30, 2024
e3dd9c9
Install conda on macos
davidt0x Apr 30, 2024
06706e5
Turn off fail fast for conda, for debug.
davidt0x Apr 30, 2024
7e7fd76
Remove numpy upper pin in conda recipe.
davidt0x Apr 30, 2024
a6f60ee
Delete everything from setup.cfg
davidt0x Apr 30, 2024
d8dc1d7
Remove setup.cfg completely, move flake8 config to .flake8
davidt0x Apr 30, 2024
1ce5283
Specify .flake8 config
davidt0x Apr 30, 2024
a856828
Make coverage concurrency multi string
davidt0x Apr 30, 2024
be3fa93
Convert to scikit-build-core
davidt0x Jun 10, 2024
8d22da1
Specify build type as Release
davidt0x Jun 10, 2024
baeeedc
Add openmp for fcma and factoranalysis
davidt0x Jun 10, 2024
498a004
Add cibuildwheel setup
davidt0x Jun 10, 2024
77ba5e4
Add cibuildwheel to workflow.
davidt0x Jun 10, 2024
f9f4652
Turn off fail fast for now.
davidt0x Jun 10, 2024
72bfc51
Test linux windows now
davidt0x Jun 10, 2024
a472439
Add mpi4py-mpich install for cibuildwheel
davidt0x Jun 10, 2024
c21fd27
Fix mpich install command.
davidt0x Jun 10, 2024
2c19f09
cibuildwheel fixes
davidt0x Jun 10, 2024
2b41421
Remove unused sys time include from tfa
davidt0x Jun 10, 2024
eca5215
cibuildwheel fixes
davidt0x Jun 10, 2024
f37a0d4
Fixes in tfa_extension.cpp for windows.
davidt0x Jun 10, 2024
51c3fd9
Fixes for cibuildwheel
davidt0x Jun 10, 2024
a755b80
Fix race condition
davidt0x Jun 10, 2024
8116339
Windows fixes for fcma_extension
davidt0x Jun 10, 2024
f5c4151
cibuildwheel fixes
davidt0x Jun 10, 2024
8a7a5d2
Cibuildwheels fixes
davidt0x Jun 10, 2024
08c0103
fixes
davidt0x Jun 11, 2024
72ee3cb
fixes
davidt0x Jun 11, 2024
ab3894a
fixes
davidt0x Jun 11, 2024
9b4a6a2
asdasd
davidt0x Jun 11, 2024
c50230d
fixes
davidt0x Jun 11, 2024
6f2c16f
fixes
davidt0x Jun 11, 2024
d8e411f
Change np.bool to bool.
davidt0x Jun 11, 2024
ff29893
Fixes
davidt0x Jun 11, 2024
ae9413c
Add script for building libomp
davidt0x Jun 11, 2024
c6942f4
More np.bool changes
davidt0x Jun 11, 2024
7d6529f
Fix libomp build
davidt0x Jun 11, 2024
7a2068f
Add exec permission to build omp script.
davidt0x Jun 11, 2024
a4e4abf
Add check for OpenMP in CMakeLists.txt
davidt0x Sep 9, 2024
c9f3579
Make scikit build core verbose
davidt0x Sep 9, 2024
a96493f
Mark some ssrm tests as xfail.
davidt0x Sep 9, 2024
bece98f
Construct ragged arrays as dtype=object in srm.
davidt0x Sep 9, 2024
7f33fbc
Fix pip install command.
davidt0x Sep 9, 2024
7c3c829
Fix for fastsrm and ragged numpy arrays.
davidt0x Sep 30, 2024
676ca41
Style cleanups.
davidt0x Sep 30, 2024
f62dbc0
Fix issue with scipy 1.6
davidt0x Sep 30, 2024
1a67ba4
Exclude Python 3.12 and above from wheels.
davidt0x Sep 30, 2024
6722efa
Remove unused omp.h include in fcma.
davidt0x Sep 30, 2024
d1aecff
Fix for windows cibuild.
davidt0x Sep 30, 2024
c48c9d2
Disable 3.8 for now.
davidt0x Sep 30, 2024
9c884ed
Remove omp.h from tfa as well.
davidt0x Sep 30, 2024
ca6403e
Build only 64 bit wheels.
davidt0x Sep 30, 2024
3379b25
Try to fix mpiexec path windows.
davidt0x Sep 30, 2024
461fd2d
Setup mpi4py with action instead.
davidt0x Sep 30, 2024
d38d9ab
Fix cibuildwheel config, archs instead of platforms.
davidt0x Sep 30, 2024
7511886
Remove call to test at bottom of test_distributed_srm
davidt0x Sep 30, 2024
520649c
Explicitly set dtype on randint
davidt0x Sep 30, 2024
1732ff3
Skip musllinux for now.
davidt0x Sep 30, 2024
e72bade
Style cleanup.
davidt0x Sep 30, 2024
b3c6900
Fix randint dtype issue on windows.
davidt0x Oct 1, 2024
6a86744
Fix apt-get commands.
davidt0x Oct 1, 2024
07f58a8
Try yum
davidt0x Oct 1, 2024
50b0f77
Try yum
davidt0x Oct 1, 2024
45bbf16
Remove pin on cibuildwheel
davidt0x Oct 1, 2024
a4fe088
Try disabling epel from yum
davidt0x Oct 1, 2024
d690cbc
More linux and windows fixes.
davidt0x Oct 1, 2024
afabf12
More linux and windows fixes.
davidt0x Oct 1, 2024
b1d5346
For linux cibuildwheel, build mpi4py wheel.
davidt0x Oct 2, 2024
54044d1
Try using intel mpi for windows.
davidt0x Oct 2, 2024
847fd91
Handle escaping windows path in regex.
davidt0x Oct 2, 2024
935a797
More windows and linux cibuildwheel fixes
davidt0x Oct 2, 2024
c8b3e80
Dont install mpi4py wheel on linux.
davidt0x Oct 2, 2024
0a0537d
Dont install mpi4py wheel on linux.
davidt0x Oct 2, 2024
5225f31
Fixes for muslinux
davidt0x Oct 2, 2024
748be1e
Re-enable MPI for windows.
davidt0x Oct 2, 2024
dc47760
Skip muslinux
davidt0x Oct 2, 2024
b11d953
Remove theano dependency.
davidt0x Oct 2, 2024
23d9c39
Try python 3.12 and above now with theano gone.
davidt0x Oct 2, 2024
d6f8d1f
Style cleanup
davidt0x Oct 2, 2024
69f88ec
Enable MPI again on windows. Drop Python 3.13.
davidt0x Oct 2, 2024
cf9c1ae
Actually skip musllinux.
davidt0x Oct 2, 2024
cc8529d
Fix a bunch of deprecation warnings.
davidt0x Oct 2, 2024
3344931
Attempt to fix conda build
davidt0x Oct 2, 2024
3cbe981
More removal of deprecated pkg_resources
davidt0x Oct 3, 2024
1ca65b4
Make voxel selection tests deterministic.
davidt0x Oct 3, 2024
200131e
Support specifying pool_size on SearchLight construction
davidt0x Oct 3, 2024
8cd3be6
Use pytest.raises match syntax in test_htfa
davidt0x Oct 3, 2024
7d217b7
Cleanup MPI tests.
davidt0x Oct 4, 2024
0c90478
Try adding openmpi to PATH.
davidt0x Oct 4, 2024
710699f
Fix openmpi path.
davidt0x Oct 4, 2024
0315663
Whoops, left this commented out.
davidt0x Oct 4, 2024
fa64acd
Style cleanups
davidt0x Oct 4, 2024
b3bbdbb
Fix test for Open MPI
davidt0x Oct 4, 2024
df09ea5
Debug linux openmpi install
davidt0x Oct 4, 2024
e62802f
Another attempt to add mpi to PATH
davidt0x Oct 4, 2024
0087f6d
Define __version__ in __init__.py
davidt0x Oct 4, 2024
d480480
Try add PATH to cibuildwheel linux environment.
davidt0x Oct 4, 2024
652f4b6
Try add PATH to cibuildwheel linux environment again.
davidt0x Oct 4, 2024
6ceee6c
Add F401 for __init__.py flake8 ignore.
davidt0x Oct 4, 2024
99a6288
Add OMPI_ALLOW_RUN_AS_ROOT to linux environment,
davidt0x Oct 4, 2024
3049cf6
Enable MPI run as root.
davidt0x Oct 4, 2024
4c0b586
Enable MPI run as root.
davidt0x Oct 4, 2024
ab4ebe2
Enable MPI run as root.
davidt0x Oct 4, 2024
64fd4a2
Enable MPI run as root.
davidt0x Oct 4, 2024
d1bf219
Fix indent
davidt0x Oct 4, 2024
de50ef5
Another workaround for old MPI
davidt0x Oct 4, 2024
881338b
Attempt to fix conda build
davidt0x Oct 14, 2024
bc178e1
No pytest-mpiexec in conda
davidt0x Oct 14, 2024
2fd0838
Hard code version
davidt0x Oct 14, 2024
a448189
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
044b04f
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
1920145
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
cfedaae
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
351d9b9
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
6e191de
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
15d80ae
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
62b5479
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
d67ce49
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
4917a8f
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
8862dda
Try to get version from setuptools_scm
davidt0x Oct 14, 2024
4b6d769
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
1f05ea8
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
31650af
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
c10d6d4
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
3bc00a1
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
fb6257c
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
9166756
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
5cba769
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
47d37f4
Add pytest-mpiexec plugin to source.
davidt0x Oct 14, 2024
019f2fc
Typo
davidt0x Oct 14, 2024
39a973b
Typo
davidt0x Oct 14, 2024
4e3c158
Refactor package to src layout
davidt0x Oct 14, 2024
af07070
Refactor package to src layout
davidt0x Oct 15, 2024
0b58413
Try to install pymanopt in script
davidt0x Oct 15, 2024
446bf76
Try to install pymanopt in script
davidt0x Oct 15, 2024
365185c
Re-add sim_parameters that were git ignored
davidt0x Oct 15, 2024
969bc1f
Another src refactor fix for docs.
davidt0x Oct 15, 2024
3f0c13d
Remove MKL_THREADING_LAYER=GNU
davidt0x Oct 15, 2024
a50c5c5
Not sure why this got set to #!/bin/sh
davidt0x Oct 15, 2024
6f8d6b5
Remove BRAINIAK_HOME
davidt0x Oct 15, 2024
08bc414
Update some actions
davidt0x Oct 15, 2024
0a3e74d
Add windows and macos-13 to conda build
davidt0x Oct 15, 2024
1d5630b
Cleanup conda build in actions
davidt0x Oct 15, 2024
ac476ad
Cleanup conda build in actions
davidt0x Oct 15, 2024
019d140
Cleanup conda build in actions
davidt0x Oct 15, 2024
16d6295
Cleanup conda build in actions
davidt0x Oct 15, 2024
f4dc4fa
Cleanup conda build in actions
davidt0x Oct 15, 2024
d0900ed
Fix condition for windows setuptools_scm
davidt0x Oct 15, 2024
8c6948a
Try to fix conda build command.
davidt0x Oct 15, 2024
6ae4b15
Try to fix conda build command.
davidt0x Oct 15, 2024
80ffdeb
Try to fix conda build command.
davidt0x Oct 15, 2024
9ff4e93
Try to fix conda build command.
davidt0x Oct 15, 2024
1855244
Try to fix conda build command.
davidt0x Oct 15, 2024
b73cb22
Try to fix conda build command.
davidt0x Oct 15, 2024
e9ec71a
Try to fix conda build command.
davidt0x Oct 15, 2024
b134183
Try to fix conda build command.
davidt0x Oct 15, 2024
0f6f16d
Add fetch-depth: 0 to checkouts
davidt0x Oct 15, 2024
7690b75
Build OpenMP for macos wheels.
davidt0x Oct 28, 2024
104df55
np.NaN to np.nan for numpy 2.0
davidt0x Oct 28, 2024
706d244
Fixes for numpy 2 np.linalg.solve changes.
davidt0x Oct 28, 2024
4f359fb
Flake8 fixes.
davidt0x Oct 28, 2024
f4641a3
Correct fix for numpy 2.
davidt0x Oct 28, 2024
346630d
Flake 8 fixes.
davidt0x Oct 28, 2024
a4f8ef1
Fix for numpy 2.
davidt0x Oct 28, 2024
ddee651
Fix for numpy 2.
davidt0x Oct 30, 2024
d2a2cfe
Remove THEANO_FLAGS.
davidt0x Oct 30, 2024
f039fd0
Cleanup tests workflow.
davidt0x Nov 13, 2024
07f025e
Bump the lower pin on tensorflow.
davidt0x Nov 13, 2024
e3d88c6
Fix openmp setup on MacOS
davidt0x Nov 13, 2024
9ce91e4
Attempt to fix windows conda build
davidt0x Nov 13, 2024
e96c8e5
Upper pin on tables 3.9 in examples-requirements.txt
davidt0x Nov 13, 2024
0c5978c
Drop tensorflow requirement conda windows.
davidt0x Nov 13, 2024
3a32d13
Remove PIP_NO_INDEX=False
davidt0x Nov 13, 2024
4415e3d
Drop nltools req.
davidt0x Nov 13, 2024
716404b
Add PIP_NO_INDEX to env.
davidt0x Nov 13, 2024
02bac2a
Put PIP_NO_INDEX back.
davidt0x Nov 13, 2024
d87edb8
Increase timeout on hfta test.
davidt0x Nov 13, 2024
82b7fab
Try again conda windows.
davidt0x Nov 13, 2024
c41dcfa
Drop windows conda for now.
davidt0x Nov 14, 2024
f59c05a
Fix INSTALL_NAME_DIR for openmp
davidt0x Nov 14, 2024
7a58f26
Put back lower pin on TF 2.16
davidt0x Nov 14, 2024
6fcfd12
Upper pin of TFP.
davidt0x Nov 14, 2024
33dfbd4
Increase timeout to 120 on all mpi tests.
davidt0x Nov 14, 2024
4e2da32
Refactor workflows into cd.yml and ci.yml
davidt0x Nov 14, 2024
88545a2
Fix syntax error.
davidt0x Nov 14, 2024
51e0917
Fix syntax error.
davidt0x Nov 14, 2024
ed095c1
Try msmpi on windows, having intelmpi issues.
davidt0x Nov 14, 2024
b815a55
Uncomment uploading to conda and pypi.
davidt0x Nov 15, 2024
826727f
Add windows tests.
davidt0x Nov 15, 2024
fae6b09
Use msmpi on windows.
davidt0x Nov 15, 2024
8b3189e
Merge branch 'master' of https://github.com/brainiak/brainiak into py…
davidt0x Nov 15, 2024
97366b5
Build wheels only on release or PR.
davidt0x Nov 15, 2024
ba6e9de
Add testing for Python 3.12 and conda build for 3.12
davidt0x Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .conda/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ then
out_dir=conda_build_out_dir/
fi

export BRAINIAK_HOME=$DIR/../../

# See run-tests.sh
export MKL_THREADING_LAYER=GNU

# See https://github.com/brainiak/brainiak/issues/377
export KMP_DUPLICATE_LIB_OK=TRUE

Expand Down
9 changes: 0 additions & 9 deletions .conda/build.sh

This file was deleted.

79 changes: 43 additions & 36 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,72 +1,79 @@
{% set conda_package_nonexistent = (
"pymanopt<=0.2.5",
) %}
{% set data = load_setup_py_data() %}

package:
# Repeating name because of the following issue:
# https://github.com/conda/conda-build/issues/2475
name: brainiak
version: {{ environ.get('GIT_DESCRIBE_TAG', 'v0.1.dev1')[1:] }}

# Can't find a good way to get this from setuptools_scm. This needs to be defined before running conda-build
version: {{ environ.get('BRAINIAK_VERSION') }}

about:
home: {{ data.get('url') }}
license: {{ data.get('license') }}
summary: {{ data.get('description') }}
home: http://brainiak.org
license: Apache-2.0
license_family: Apache
license_file: LICENSE
summary: |
The Brain Imaging Analysis Kit is a package of Python modules
useful for neuroscience, primarily focused on functional
Magnetic Resonance Imaging (fMRI) analysis. The package was originally
created by a collaboration between Intel and the
Princeton Neuroscience Institute (PNI).

source:
path: ../

build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
script_env:

# We need the source directory because conda removes source / working
# directories by the time we reach the test phase. We can optionally pass in
# the --keep-old-work flag later on to use the $PREFIX/work directory
- BRAINIAK_HOME
- MKL_THREADING_LAYER
- KMP_DUPLICATE_LIB_OK

script:
- PIP_NO_INDEX=False {{ PYTHON }} -m pip install pymanopt
- {{ PYTHON }} -m pip install . -v

requirements:
build:
- python
- {{ compiler('cxx') }}

host:
- python
- pip
- mpich
- mpich # [not win]
- llvm-openmp
- setuptools>=42
- wheel
- scikit-build-core
- cmake
- setuptools_scm>=8.0
- pybind11>=2.9.0
- scipy!=1.0.0
- cython
- numpy<=1.23.1
- setuptools_scm
- numpy

run:
- python
- numpy<=1.23.1
- mpich
- llvm-openmp
- tensorflow
- tensorflow-probability
{% for req in data.get('install_requires', [])
if req not in conda_package_nonexistent -%}
- {{req}}
{% endfor %}
- {{ pin_compatible('numpy') }}
- mpi4py>=3
- nitime
- scikit-learn>=0.18
- scipy!=1.0.0
- statsmodels
- psutil
- nibabel
- joblib
- wheel
- pydicom
- tensorflow # [not win]
- tensorflow-probability # [not win]

test:
source_files:
- tests
- pyproject.toml
imports:
- brainiak
commands:
- find $BRAINIAK_HOME/tests | grep pycache | xargs rm -rf
- mpiexec -n 2 pytest $BRAINIAK_HOME

# Known issue: https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959
- python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
- conda inspect linkages -p $PREFIX brainiak # [not win]
- conda inspect objects -p $PREFIX brainiak # [osx]
- pytest
requires:
- pytest
- testbook
- numdifftools
- pytest-reportlog
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
max-complexity = 10
extend-ignore =
# Docstrings
D,
E721,
E231

per-file-ignores =
src/brainiak/__init__.py:F401
200 changes: 200 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
name: wheels and conda

on:
workflow_dispatch:
release:
types:
- published
pull_request:
paths:
- .github/workflows/cd.yml

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3

jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

build_wheels:
name: Wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
fail-fast: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Use intel mpi on windows
- uses: mpi4py/setup-mpi@v1
if: ${{ contains(matrix.os, 'windows') }}
with:
mpi: msmpi

# Else, use the default for the OS and setup-mpi action
- uses: mpi4py/setup-mpi@v1
if: ${{ !contains(matrix.os, 'windows') }}

- name: Checkout LLVM on macOS
if: runner.os == 'macOS'
uses: actions/checkout@v4
with:
repository: llvm/llvm-project
ref: release/18.x
path: llvm-project

- name: Build OpenMP on macOS
if: runner.os == 'macOS'
env:
MACOSX_DEPLOYMENT_TARGET: "10.9"
working-directory: llvm-project
run: |
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$(brew --prefix) \
-DCMAKE_INSTALL_NAME_DIR=$(brew --prefix)/lib \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLIBOMP_INSTALL_ALIASES=OFF \
-S openmp \
-B build
cmake --build build --parallel
cmake --install build

- uses: actions/setup-python@v5

- name: Install cibuildwheel
run: python -m pip install cibuildwheel

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_conda:
name: Conda on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -leo pipefail {0}
strategy:
matrix:
os: [ ubuntu-latest, macos-13, macos-latest ]
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Can't figure out a way to get the package version from setuptools_scm inside the conda build
# We need to install setuptools_scm, call it as a module, and store the version in an environment variable
- name: Run setuptools_scm to get package version and store in environment variable BRAINIAK_VERSION (Linux\Mac)
if: ${{ !contains(matrix.os, 'windows') }}
run: |
python -m pip install setuptools_scm
export BRAINIAK_VERSION=$(python -m setuptools_scm)
echo "BRAINIAK_VERSION=${BRAINIAK_VERSION}" >> "$GITHUB_ENV"

- name: Run setuptools_scm to get package version and store in environment variable BRAINIAK_VERSION (Windows)
if: ${{ contains(matrix.os, 'windows') }}
run: |
python -m pip install setuptools_scm
set BRAINIAK_VERSION=$(python -m setuptools_scm)
echo "BRAINIAK_VERSION=${BRAINIAK_VERSION}" >> "$GITHUB_ENV"

- name: Setup micromamba and boa
uses: mamba-org/setup-micromamba@v1
with:
environment-name: test-env
create-args: >-
python=${{ matrix.python-version }}
conda-forge::conda-build
boa
init-shell: >-
bash
powershell

- name: Build and test package
id: build-package
run: |
conda config --add channels conda-forge
conda config --set channel_priority strict
conda mambabuild --output-folder=conda-package .conda/

- uses: actions/upload-artifact@v4
with:
name: conda-package-${{ matrix.os }}-${{ matrix.python-version }}
path: conda-package

publish_pypi:
name: Publish to PyPI
needs: [ build_wheels, build_conda, make_sdist ]
environment:
name: pypi
url: https://pypi.org/p/brainiak
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: List files in artifact(s)
run: ls -l dist

- uses: pypa/gh-action-pypi-publish@release/v1

publish_conda:
name: Publish to Anaconda
needs: [ build_conda, build_wheels, make_sdist ]
environment: anaconda
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')

steps:
- uses: actions/download-artifact@v4
with:
pattern: conda-package-*
path: conda-packages
merge-multiple: false

- name: List files in artifact
run: find conda-packages -type f -name "*.tar.bz2"

- name: Upload to Anaconda
run: |
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
find conda-packages -type f -name "*.tar.bz2" -exec echo "anaconda upload {}" \;

Loading
Loading