Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliby-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Swain Lab
aliby
aliby-mirror
Commits
03d49872
Commit
03d49872
authored
3 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
add automated ci and clean up unused imports
parent
c529de9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+37
-13
37 additions, 13 deletions
.gitlab-ci.yml
aliby/segment.py
+2
-13
2 additions, 13 deletions
aliby/segment.py
with
39 additions
and
26 deletions
.gitlab-ci.yml
+
37
−
13
View file @
03d49872
image
:
python:3.7
cache
:
key
:
"
project-${CI_JOB_NAME}"
paths
:
-
.cache/pip
-
.venv
key
:
files
:
-
poetry.lock
stages
:
-
test
-
check
-
deploy
-
release
before_script
:
-
test -e $HOME/.poetry/bin/ || curl -sSL
curl -sSL
https://install.python-poetry.org | python3 -
-
test -e $HOME/.poetry/bin/ || curl -sSL https://install.python-poetry.org | python3 -
-
export PATH="$PATH:$HOME/.local/bin/"
-
poetry
config virtualenvs.create
false
-
rm -f poetry.lock
-
poetry
--version
-
poetry config virtualenvs.in-project
true
-
pip install --upgrade pip
-
poetry install
-
git remote rm origin && git remote add origin https://${ACCESS_TOKEN_NAME}:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
-
git pull
-
if [ ${var+TRIGGER_PYPI_NAME} ]; then echo "Pipeline triggered by ${TRIGGER_PYPI_NAME}"; poetry update ${TRIGGER_PYPI_NAME}; fi
-
poetry install -vv
Unit test
:
stage
:
test
allow_failure
:
true
script
:
-
pytest ./tests/
-
poetry run
pytest ./tests/
Python Code Lint
:
stage
:
check
script
:
-
black .
-
poetry run
black .
Static Type
:
stage
:
check
allow_failure
:
true
script
:
-
mypy . --exclude 'setup\.py$'
-
poetry run
mypy . --exclude 'setup\.py$'
# We can remove the flag once this is resolved https://github.com/pypa/setuptools/issues/2345
Publish to pypi and update repository
:
stage
:
deploy
Bump version and release
:
stage
:
release
script
:
-
poetry version ${BUMP_RULE}
-
git config --global user.email ${GITLAB_USER_EMAIL}
-
git config --global user.name ${GITLAB_USER_NAME}
-
git add pyproject.toml
-
git add pyproject.toml
poetry.lock
-
git commit -m "Bump version"
-
git remote set-url origin https://${ACCESS_TOKEN_NAME}:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
-
git push -o ci.skip origin HEAD:master && poetry publish --build --username ${PYPI_USER} --password ${PYPI_PASSWORD}
# - git pull && git push -o ci.skip origin HEAD:master && poetry publish --build --username ${PYPI_USER} --password ${PYPI_PASSWORD}
-
git pull && git push -o ci.skip origin HEAD:master
-
echo "TRIGGER_PYPI_NAME=$(cat pyproject.toml | grep '^name =' | head -n 1 | cut -f3 -d' ' | tr -d \")" >> build.env
artifacts
:
reports
:
dotenv
:
build.env
only
:
-
master
except
:
changes
:
-
tests/*
needs
:
job
:
Unit test
## Custom stages ##
This diff is collapsed.
Click to expand it.
aliby/segment.py
+
2
−
13
View file @
03d49872
...
...
@@ -13,19 +13,8 @@ from skimage.registration import phase_cross_correlation
from
agora.base
import
ParametersABC
,
ProcessABC
from
aliby.traps
import
segment_traps
from
aliby.timelapse
import
TimelapseOMERO
from
aliby.io.matlab
import
matObject
from
aliby.traps
import
(
identify_trap_locations
,
get_trap_timelapse
,
get_traps_timepoint
,
centre
,
get_trap_timelapse_omero
,
)
from
aliby.utils
import
accumulate
,
get_store_path
from
aliby.io.writer
import
Writer
,
load_attributes
from
aliby.io.metadata_parser
import
parse_logfiles
from
aliby.io.writer
import
load_attributes
trap_template_directory
=
Path
(
__file__
).
parent
/
"
trap_templates
"
# TODO do we need multiple templates, one for each setup?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment