Skip to content

Commit 6e9810b

Browse files
authored
Merge pull request #137 from pwalczysko/fix-build-wills-fix
Fix build & pkg_resources fix
2 parents 3e27397 + 64899ab commit 6e9810b

File tree

6 files changed

+43
-105
lines changed

6 files changed

+43
-105
lines changed

.github/workflows/workflow.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
python-version:
18-
- '3.8'
18+
- '3.10'
1919
os:
20-
- ubuntu-20.04
20+
- ubuntu-22.04
2121
commands:
2222
- 'install'
2323
runs-on: ${{ matrix.os }}
2424
services:
2525
postgres:
26-
image: postgres:11
26+
image: postgres:16
2727
env:
2828
POSTGRES_DB: omero
2929
POSTGRES_PASSWORD: omero
@@ -37,9 +37,9 @@ jobs:
3737
--health-timeout 5s
3838
--health-retries 5
3939
steps:
40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v4
4141
- name: Install Ice Java and Python binding
42-
uses: ome/action-ice@v1
42+
uses: ome/action-ice@v4
4343
- name: Install Python dependencies
4444
run: |
4545
pip install flake8 tox wheel pytest

ci-build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ set -e
44
set -u
55
set -x
66

7+
python --version
8+
pip install setuptools==v71.1.0
9+
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
10+
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
11+
sudo apt update
12+
sudo apt install postgresql
713
python setup.py test -t test/unit -v
814
python setup.py test -t test/integration -v -m "not slowtest"
915
python setup.py sdist install
@@ -29,7 +35,7 @@ if [ $TEST = install ]; then
2935
# Check db dump file
3036
omego db dump --serverdir OMERO.server --dumpfile omero.pgdump
3137

32-
pg_restore -l omero.pgdump | grep 'dbpatch_versions_trigger'
38+
pg_restore --host=localhost -l omero.pgdump | grep 'dbpatch_versions_trigger'
3339
fi
3440

3541
#Test a multistage DB upgrade (5.3 -> 5.4) as part of the server upgrade

omego/version.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from __future__ import print_function
2424
import yaclifw.version
25-
from pkg_resources import resource_string
25+
import os
2626

2727

2828
class Version(yaclifw.version.Version):
@@ -32,4 +32,10 @@ class Version(yaclifw.version.Version):
3232

3333
def __call__(self, args):
3434
super(yaclifw.version.Version, self).__call__(args)
35-
print(resource_string(__name__, 'RELEASE-VERSION').rstrip())
35+
36+
# print version from RELEASE-VERSION file
37+
base_dir = os.path.dirname(os.path.abspath(__file__))
38+
file_path = os.path.join(base_dir, 'RELEASE-VERSION')
39+
with open(file_path, 'r') as f:
40+
data = f.read()
41+
print(data)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def run_tests(self):
131131

132132
cmdclass={'test': PyTest},
133133
tests_require=[
134-
'pytest>4,<5',
134+
'pytest>4',
135135
'restview',
136136
'mox3',
137137
],

test/integration/test_download.py

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121

2222
from __future__ import division
23-
from past.utils import old_div
2423
from builtins import object
2524
import pytest # noqa
2625

@@ -38,74 +37,6 @@ def download(self, *args):
3837
main("omego", args=args, items=[("download", DownloadCommand)])
3938

4039

41-
class TestDownloadJenkins(Downloader):
42-
43-
def setup_class(self):
44-
self.artifact = 'java'
45-
self.branch = 'OMERO-build'
46-
self.ice = '3.6'
47-
48-
def testDownloadNoUnzip(self, tmpdir):
49-
with tmpdir.as_cwd():
50-
self.download('--skipunzip', '--branch', self.branch,
51-
'--ice', self.ice)
52-
files = tmpdir.listdir()
53-
assert len(files) == 1
54-
55-
def testDownloadUnzip(self, tmpdir):
56-
with tmpdir.as_cwd():
57-
self.download('--branch', self.branch, '--ice', self.ice)
58-
files = tmpdir.listdir()
59-
assert len(files) == 2
60-
61-
def testDownloadUnzipDir(self, tmpdir):
62-
with tmpdir.as_cwd():
63-
self.download('--unzipdir', 'OMERO.java', '--branch', self.branch,
64-
'--ice', self.ice)
65-
expected = old_div(tmpdir, 'OMERO.java')
66-
assert expected.exists()
67-
assert expected.isdir()
68-
69-
def testDownloadSym(self, tmpdir):
70-
with tmpdir.as_cwd():
71-
self.download('--branch', self.branch, '--ice', self.ice,
72-
'--sym', 'auto')
73-
files = tmpdir.listdir()
74-
assert len(files) == 3
75-
76-
expected = old_div(tmpdir, 'OMERO.java')
77-
assert expected.exists()
78-
assert expected.isdir()
79-
80-
# Part two, if an artifact already exists and is unzipped check
81-
# that a new symlink is created if necessary
82-
self.download('--branch', self.branch, '--ice', self.ice,
83-
'--sym', 'custom.sym')
84-
files2 = tmpdir.listdir()
85-
files2diff = set(files2).symmetric_difference(files)
86-
assert len(files2diff) == 1
87-
sym2 = files2diff.pop()
88-
assert sym2 == (old_div(tmpdir, 'custom.sym'))
89-
assert sym2.isdir()
90-
91-
def testDownloadBuildNumber(self):
92-
# Old Jenkins artifacts are deleted so we can't download.
93-
# Instead assert that an AttributeError is raised.
94-
# This is not ideal since this error could occur for other reasons.
95-
branch = self.branch + ':600'
96-
with pytest.raises(AttributeError) as exc:
97-
self.download('--branch', branch, '--ice', self.ice)
98-
assert 'No artifacts' in exc.value.args[0]
99-
100-
def testDownloadList(self, tmpdir):
101-
self.artifact = ''
102-
self.branch = 'latest'
103-
with tmpdir.as_cwd():
104-
self.download('--branch', self.branch)
105-
files = tmpdir.listdir()
106-
assert len(files) == 0
107-
108-
10940
class TestDownloadRelease(Downloader):
11041

11142
def setup_class(self):
@@ -121,18 +52,3 @@ def testDownloadRelease(self, tmpdir):
12152
def testDownloadNonExistingArtifact(self):
12253
with pytest.raises(AttributeError):
12354
self.download('-n', '--release', '5.3', '--ice', '3.3')
124-
125-
126-
class TestDownloadBioFormats(Downloader):
127-
128-
def setup_class(self):
129-
self.branch = 'BIOFORMATS-build'
130-
131-
def testDownloadJar(self, tmpdir):
132-
self.artifact = 'formats-api'
133-
with tmpdir.as_cwd():
134-
self.download('--branch', self.branch)
135-
files = tmpdir.listdir()
136-
assert len(files) == 1
137-
assert files[0].basename.endswith(".jar")
138-
assert files[0].basename.startswith('formats-api')

tox.ini

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,42 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27, py38
7+
envlist = py310
88
# https://tox.readthedocs.io/en/latest/config.html#conf-requires
99
# Ensure pip is new so we can install manylinux wheel
1010
requires = pip >= 19.0.0
1111
virtualenv >= 16.0.0
1212

1313
[testenv]
1414
# Variables used by ci-build
15-
passenv = HOME USER_AGENT TEST
15+
passenv = HOME, USER_AGENT, TEST
16+
allowlist_externals = bash
1617
commands =
1718
; python setup.py test -vst test/unit/
18-
./ci-build
19+
bash ./ci-build
1920

20-
[testenv:py27ci]
21-
basepython = python2.7
22-
platform = linux.*
23-
deps =
24-
setuptools>=40.0
25-
https://github.com/ome/zeroc-ice-py-manylinux/releases/download/0.1.0/zeroc_ice-3.6.5-cp27-cp27mu-manylinux2010_x86_64.whl
2621

27-
[testenv:py38ci]
28-
basepython = python3.8
22+
23+
[testenv:py310ci]
24+
basepython = python3.10
2925
platform = linux.*
3026
deps =
3127
setuptools>=40.0
32-
https://github.com/ome/zeroc-ice-ubuntu2004/releases/download/0.2.0/zeroc_ice-3.6.5-cp38-cp38-linux_x86_64.whl
28+
https://github.com/glencoesoftware/zeroc-ice-py-linux-x86_64/releases/download/20240202/zeroc_ice-3.6.5-cp310-cp310-manylinux_2_28_x86_64.whl
29+
30+
; [testenv:py312ci]
31+
; basepython = python3.12
32+
; platform = linux.*
33+
; deps =
34+
; setuptools>=40.0
35+
; https://github.com/glencoesoftware/zeroc-ice-py-linux-x86_64/releases/download/20240202/zeroc_ice-3.6.5-cp312-cp312-manylinux_2_28_x86_64.whl
36+
37+
; [testenv:py311ci]
38+
; basepython = python3.11
39+
; platform = linux.*
40+
; deps =
41+
; ; setuptools>=40.0
42+
; https://github.com/glencoesoftware/zeroc-ice-py-linux-x86_64/releases/download/20240202/zeroc_ice-3.6.5-cp311-cp311-manylinux_2_28_x86_64.whl
3343

3444
; [testenv:py27]
3545
; basepython = /CONDA/envs/tox-py27/bin/python

0 commit comments

Comments
 (0)