Skip to content

Commit 1fd9540

Browse files
authored
Merge pull request #400 from HSF/dev
fix setup.py to custom install
2 parents b47d735 + 46abf4a commit 1fd9540

File tree

33 files changed

+326
-39
lines changed

33 files changed

+326
-39
lines changed

atlas/lib/idds/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
#
88
# Authors:
99
# - Wen Guan, <[email protected]>, 2019
10+
11+
# idds atlas

atlas/lib/idds/atlas/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# - Wen Guan, <[email protected]>, 2019 - 2021
1010

1111

12-
release_version = "2.1.30"
12+
release_version = "2.2.21"

atlas/setup.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,36 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2019
9+
# - Wen Guan, <[email protected]>, 2019 - 2025
1010

1111

1212
import glob
13+
import logging
1314
import io
1415
import os
1516
import re
1617
import sys
1718
import sysconfig
1819
from setuptools import setup, find_packages
20+
from setuptools.command.install import install
21+
22+
23+
# Configure logging
24+
logging.basicConfig(level=logging.INFO)
25+
logger = logging.getLogger(__name__)
26+
27+
28+
class CustomInstallCommand(install):
29+
"""Custom install command to exclude top-level 'idds' during installation."""
30+
def run(self):
31+
# Remove 'idds' from the list of packages before installation
32+
logger.info("idds-atlas installing")
33+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
34+
self.distribution.packages = [
35+
pkg for pkg in self.distribution.packages if pkg != 'idds'
36+
]
37+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
38+
super().run()
1939

2040

2141
current_dir = os.getcwd()
@@ -99,6 +119,9 @@ def parse_requirements(requirements_files):
99119
include_package_data=True,
100120
data_files=data_files,
101121
scripts=scripts,
122+
cmdclass={
123+
'install': CustomInstallCommand, # Exclude 'idds' during installation
124+
},
102125
project_urls={
103126
'Documentation': 'https://github.com/HSF/iDDS/wiki',
104127
'Source': 'https://github.com/HSF/iDDS',

atlas/tools/atlas/env/environment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ dependencies:
1212
- panda-client-light # panda client
1313
- rucio-clients
1414
- rucio-clients-atlas
15-
- idds-common==2.1.30
16-
- idds-workflow==2.1.30
15+
- idds-common==2.2.21
16+
- idds-workflow==2.2.21

client/lib/idds/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
#
88
# Authors:
99
# - Wen Guan, <[email protected]>, 2019
10+
11+
# idds client

client/lib/idds/client/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# - Wen Guan, <[email protected]>, 2019 - 2021
1010

1111

12-
release_version = "2.1.30"
12+
release_version = "2.2.21"

client/setup.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,36 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2019
9+
# - Wen Guan, <[email protected]>, 2019 - 2025
1010

1111

1212
import glob
1313
import io
14+
import logging
1415
import os
1516
import re
1617
import sys
1718
import sysconfig
1819
from setuptools import setup, find_packages
20+
from setuptools.command.install import install
21+
22+
23+
# Configure logging
24+
logging.basicConfig(level=logging.INFO)
25+
logger = logging.getLogger(__name__)
26+
27+
28+
class CustomInstallCommand(install):
29+
"""Custom install command to exclude top-level 'idds' during installation."""
30+
def run(self):
31+
# Remove 'idds' from the list of packages before installation
32+
logger.info("idds-client installing")
33+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
34+
self.distribution.packages = [
35+
pkg for pkg in self.distribution.packages if pkg != 'idds'
36+
]
37+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
38+
super().run()
1939

2040

2141
current_dir = os.getcwd()
@@ -99,6 +119,9 @@ def parse_requirements(requirements_files):
99119
include_package_data=True,
100120
data_files=data_files,
101121
scripts=scripts,
122+
cmdclass={
123+
'install': CustomInstallCommand, # Exclude 'idds' during installation
124+
},
102125
project_urls={
103126
'Documentation': 'https://github.com/HSF/iDDS/wiki',
104127
'Source': 'https://github.com/HSF/iDDS',

client/tools/client/env/environment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ dependencies:
77
- urllib3 # url connections
88
- tabulate
99
- argcomplete
10-
- idds-common==2.1.30
11-
- idds-workflow==2.1.30
10+
- idds-common==2.2.21
11+
- idds-workflow==2.2.21

common/lib/idds/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
#
88
# Authors:
99
# - Wen Guan, <[email protected]>, 2019
10+
11+
# idds common

common/lib/idds/common/constants.py

+39-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2019 - 2023
9+
# - Wen Guan, <[email protected]>, 2019 - 2025
1010

1111
"""
1212
Constants.
@@ -129,6 +129,44 @@ class WorkStatus(IDDSEnum):
129129
Terminating = 21
130130

131131

132+
class RequestGroupStatus(IDDSEnum):
133+
New = 0
134+
Ready = 1
135+
Transforming = 2
136+
Finished = 3
137+
SubFinished = 4
138+
Failed = 5
139+
Extend = 6
140+
ToCancel = 7
141+
Cancelling = 8
142+
Cancelled = 9
143+
ToSuspend = 10
144+
Suspending = 11
145+
Suspended = 12
146+
ToResume = 13
147+
Resuming = 14
148+
ToExpire = 15
149+
Expiring = 16
150+
Expired = 17
151+
ToFinish = 18
152+
ToForceFinish = 19
153+
Terminating = 20
154+
Building = 21
155+
Built = 22
156+
Throttling = 23
157+
ToClose = 24
158+
159+
160+
class RequestGroupLocking(IDDSEnum):
161+
Idle = 0
162+
Locking = 1
163+
164+
165+
class RequestGroupType(IDDSEnum):
166+
Workflow = 0
167+
Other = 99
168+
169+
132170
class RequestStatus(IDDSEnum):
133171
New = 0
134172
Ready = 1

common/lib/idds/common/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# - Wen Guan, <[email protected]>, 2019 - 2021
1010

1111

12-
release_version = "2.1.30"
12+
release_version = "2.2.21"

common/setup.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,36 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2019
9+
# - Wen Guan, <[email protected]>, 2019 - 2025
1010

1111

1212
import glob
13+
import logging
1314
import io
1415
import os
1516
import re
1617
import sys
1718
import sysconfig
1819
from setuptools import setup, find_packages
20+
from setuptools.command.install import install
21+
22+
23+
# Configure logging
24+
logging.basicConfig(level=logging.INFO)
25+
logger = logging.getLogger(__name__)
26+
27+
28+
class CustomInstallCommand(install):
29+
"""Custom install command to exclude top-level 'idds' during installation."""
30+
def run(self):
31+
# Remove 'idds' from the list of packages before installation
32+
logger.info("idds-common installing")
33+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
34+
self.distribution.packages = [
35+
pkg for pkg in self.distribution.packages if pkg != 'not'
36+
]
37+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
38+
super().run()
1939

2040

2141
current_dir = os.getcwd()
@@ -101,6 +121,9 @@ def parse_requirements(requirements_files):
101121
include_package_data=True,
102122
data_files=data_files,
103123
scripts=scripts,
124+
cmdclass={
125+
'install': CustomInstallCommand, # Exclude 'idds' during installation
126+
},
104127
project_urls={
105128
'Documentation': 'https://github.com/HSF/iDDS/wiki',
106129
'Source': 'https://github.com/HSF/iDDS',

doma/lib/idds/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2019
9+
# - Wen Guan, <[email protected]>, 2019 - 2025
10+
11+
# idds doma

doma/lib/idds/doma/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# - Wen Guan, <[email protected]>, 2020 - 2021
1010

1111

12-
release_version = "2.1.30"
12+
release_version = "2.2.21"

doma/setup.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,36 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2019
9+
# - Wen Guan, <[email protected]>, 2019 - 2025
1010

1111

1212
import glob
13+
import logging
1314
import io
1415
import os
1516
import re
1617
import sys
1718
import sysconfig
1819
from setuptools import setup, find_packages
20+
from setuptools.command.install import install
21+
22+
23+
# Configure logging
24+
logging.basicConfig(level=logging.INFO)
25+
logger = logging.getLogger(__name__)
26+
27+
28+
class CustomInstallCommand(install):
29+
"""Custom install command to exclude top-level 'idds' during installation."""
30+
def run(self):
31+
# Remove 'idds' from the list of packages before installation
32+
logger.info("idds-client installing")
33+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
34+
self.distribution.packages = [
35+
pkg for pkg in self.distribution.packages if pkg != 'idds'
36+
]
37+
logger.info(f"self.distribution.packages: {self.distribution.packages}")
38+
super().run()
1939

2040

2141
current_dir = os.getcwd()
@@ -99,6 +119,9 @@ def parse_requirements(requirements_files):
99119
include_package_data=True,
100120
data_files=data_files,
101121
scripts=scripts,
122+
cmdclass={
123+
'install': CustomInstallCommand, # Exclude 'idds' during installation
124+
},
102125
project_urls={
103126
'Documentation': 'https://github.com/HSF/iDDS/wiki',
104127
'Source': 'https://github.com/HSF/iDDS',

doma/tools/doma/env/environment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ dependencies:
44
- pip
55
- pip:
66
- panda-client-light # panda client
7-
- idds-common==2.1.30
8-
- idds-workflow==2.1.30
7+
- idds-common==2.2.21
8+
- idds-workflow==2.2.21

main/lib/idds/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2019
9+
# - Wen Guan, <[email protected]>, 2019 - 2025
10+
11+
# idds main

main/lib/idds/core/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# - Wen Guan, <[email protected]>, 2019 - 2021
1010

1111

12-
release_version = "2.1.30"
12+
release_version = "2.2.21"

main/lib/idds/orm/base/alembic/script.py.mako

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.apache.org/licenses/LICENSE-2.0OA
77
#
88
# Authors:
9-
# - Wen Guan, <[email protected]>, 2024
9+
# - Wen Guan, <[email protected]>, 2025
1010

1111
"""${message}
1212

0 commit comments

Comments
 (0)