-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ilastik/add-auto-deploy
add automatic deploy via ci
- Loading branch information
Showing
12 changed files
with
97 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
tags: | ||
- '1.*' | ||
|
||
jobs: | ||
package: | ||
strategy: | ||
runs-on: ubuntu-latest | ||
env: | ||
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: install xvfb/deps | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -yy mesa-utils libgl1-mesa-dev xvfb curl | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
auto-activate-base: true | ||
activate-environment: bld-env | ||
environment-file: .github/workflows/etc/bld-environment.yml | ||
condarc-file: .github/workflows/etc/conda-rc-deploy.yml | ||
miniforge-variant: Miniforge3 | ||
use-mamba: true | ||
- name: linux conda build | ||
if: matrix.os == 'ubuntu-latest' | ||
shell: bash -l {0} | ||
run: xvfb-run --server-args="-screen 0 1024x768x24" conda mambabuild -c conda-forge conda-recipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: bld-env | ||
channels: | ||
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- anaconda-client | ||
- conda-build | ||
- setuptools_scm | ||
- boa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
anaconda_upload: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ ilastikrag.egg-info | |
*.jpg | ||
*.swp | ||
*.ipynb_checkpoints | ||
|
||
ilastikrag/_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
name: ilastikrag-dev | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- h5py | ||
- networkx | ||
- numpy>=1.12,<1.20 | ||
- pandas | ||
- pip | ||
- pytest | ||
- python>=3.7 | ||
- setuptools_scm | ||
- vigra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
from __future__ import absolute_import | ||
from .version import __version__ | ||
from . import accumulators | ||
from .accumulators import BaseEdgeAccumulator | ||
from .accumulators import BaseSpAccumulator | ||
from .rag import Rag | ||
|
||
try: | ||
from ._version import version | ||
except ModuleNotFoundError: | ||
raise RuntimeError( | ||
"Couldn't determine ilastik version - if you are developing ilastik please " | ||
"make sure to use an editable install (`pip install -e .`). " | ||
"Otherwise, please report this issue to the ilastik development team: team@ilastik.org" | ||
) | ||
|
||
################## | ||
# # Version info ## | ||
################## | ||
|
||
__version__ = version |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,17 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import subprocess | ||
from setuptools import setup, find_packages | ||
import setuptools_scm | ||
|
||
def determine_version(default_version_file): | ||
# If running in conda-build, read version from the environment. | ||
if 'PKG_VERSION' in os.environ: | ||
auto_version = os.environ['PKG_VERSION'] | ||
else: | ||
# Try getting it from the latest git tag | ||
try: | ||
commit_details = subprocess.check_output("git describe --tags --long HEAD".split()).decode('utf-8') | ||
last_tag, commits_since_tag = commit_details.split('-')[:2] | ||
auto_version = last_tag | ||
if int(commits_since_tag) > 0: | ||
# Append commit count to version | ||
# (BTW, the .post## convention is recognized by PEP440) | ||
# For example: '0.2.post5' | ||
auto_version = last_tag + '.post' + commits_since_tag | ||
except subprocess.CalledProcessError: | ||
# Weird: We're not in a git repo or conda-bld/work. | ||
# Read the default value from the source code, I guess. | ||
version_globals = {} | ||
exec(compile(open(default_version_file).read(), default_version_file, 'exec'), version_globals) | ||
auto_version = version_globals['__version__'] | ||
return auto_version | ||
_version = setuptools_scm.get_version(write_to="ilastikrag/_version.py") | ||
|
||
VERSION_FILE = 'ilastikrag/version.py' | ||
auto_version = determine_version(VERSION_FILE) | ||
|
||
# Cache version.py, then overwrite it with the auto-version | ||
with open(VERSION_FILE, 'r') as f: | ||
orig_version_contents = f.read() | ||
|
||
with open(VERSION_FILE, 'w') as f: | ||
f.write("__version__ = '{}'\n".format(auto_version)) | ||
|
||
try: | ||
setup(name='ilastikrag', | ||
version=auto_version, | ||
description='ND Region Adjacency Graph with edge feature algorithms', | ||
author='Stuart Berg', | ||
author_email='bergs@janelia.hhmi.org', | ||
url='github.com/stuarteberg/ilastikrag', | ||
packages=find_packages() | ||
## see conda-recipe/meta.yaml for dependency information | ||
##install_requires=['numpy', 'h5py', 'pandas', 'vigra', 'networkx'] | ||
) | ||
finally: | ||
# Restore the version.py source as it was | ||
with open(VERSION_FILE, 'w') as f: | ||
f.write(orig_version_contents) | ||
setup(name='ilastikrag', | ||
version=_version, | ||
description='ND Region Adjacency Graph with edge feature algorithms', | ||
author='Stuart Berg', | ||
author_email='bergs@janelia.hhmi.org', | ||
url='github.com/stuarteberg/ilastikrag', | ||
packages=find_packages() | ||
## see conda-recipe/meta.yaml for dependency information | ||
##install_requires=['numpy', 'h5py', 'pandas', 'vigra', 'networkx'] | ||
) |