Skip to content

Commit

Permalink
Merge pull request #48 from will-moore/build
Browse files Browse the repository at this point in the history
Build
  • Loading branch information
jburel authored Nov 26, 2024
2 parents 6549f0f + e7276f5 commit 8698fb4
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/omero_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
env:
STAGE: app
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Checkout omero-test-infra
uses: actions/checkout@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.event.pull_request.head.sha }}
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ jobs:
name: Build and publish Python distribution to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build a binary wheel and a source tarball
run: |
python -mpip install wheel
python setup.py sdist bdist_wheel
python -mpip install build
python -m build
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.3.0
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
password: ${{ secrets.PYPI_PASSWORD }}
19 changes: 19 additions & 0 deletions .omeroci/app-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

source /infra/utils

set -e
set -u
set -x

cd $TARGET
DIR=$(setup_dir)

export DJANGO_SETTINGS_MODULE=omeroweb.settings
export OMERODIR=/opt/omero/web/OMERO.web
export ICE_CONFIG=${OMERO_DIST}/etc/ice.config

if [ -e test ]; then
echo Tests currently disabled
exit 1
fi
3 changes: 2 additions & 1 deletion idr_gallery/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
# handle mapr URLs and redirect to search e.g. /mapr/gene/?value=PAX7
# First URL is matched by mapr itself, so not used while mapr istalled...
# we want a regex that matches mapr_key but not favicon
re_path(r'^mapr/(?P<mapr_key>(?!favicon)[\w]+)/$', views.mapr, name='mapr'),
re_path(r'^mapr/(?P<mapr_key>(?!favicon)[\w]+)/$',
views.mapr, name='mapr'),
]

for c in SUPER_CATEGORIES:
Expand Down
6 changes: 4 additions & 2 deletions idr_gallery/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def find_mapr_key_value(request, mapr_key, mapr_value, exact_match=False):
# if multiple keys e.g. 'Gene Symbol' or 'Gene Identifier'
if len(all_keys) > 1:
# need to check which Key matches the Value...
matching_keys = search_engine_keys(request, mapr_value, exact_match)
matching_keys = search_engine_keys(request, mapr_value,
exact_match)
all_keys = [key for key in all_keys if key in matching_keys]
if len(all_keys) > 1 and default_key in all_keys:
mapann_key = default_key
Expand All @@ -162,7 +163,8 @@ def search_engine_keys(request, value, exact_match=False):
url += f"?value={value}"
json_data = requests.get(url).json().get("data", [])
if exact_match:
json_data = list(filter(lambda x: x.get("Value").lower() == value.lower(), json_data))
json_data = list(filter(
lambda x: x.get("Value").lower() == value.lower(), json_data))
keys = [result.get("Key") for result in json_data]
return keys

Expand Down

0 comments on commit 8698fb4

Please sign in to comment.