Skip to content

Commit 8c0504b

Browse files
committed
fix deploy
1 parent 78797e1 commit 8c0504b

File tree

7 files changed

+68
-77
lines changed

7 files changed

+68
-77
lines changed

.circleci/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
python -m pip install git+ssh://[email protected]/open-mmlab/[email protected]
6868
python -m pip install -r requirements.txt
6969
python -m pip install -r requirements/albu.txt
70+
python -m pip install -r requirements/poseval.txt
7071
- run:
7172
name: Build and install
7273
command: |
@@ -115,6 +116,7 @@ jobs:
115116
docker exec mmpose pip install -e /mmdetection
116117
docker exec mmpose pip install -r requirements.txt
117118
docker exec mmpose pip install -r requirements/albu.txt
119+
docker exec mmpose pip install -r requirements/poseval.txt
118120
- run:
119121
name: Build and install
120122
command: |

docs/en/notes/changelog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Built upon the new [training engine](https://github.com/open-mmlab/mmengine).
88

99
**Highlights**
1010

11-
- **New engines**. MMPose 1.x is based on MMEngine\](https://github.com/open-mmlab/mmengine), which provides a general and powerful runner that allows more flexible customizations and significantly simplifies the entrypoints of high-level interfaces.
11+
- **New engines**. MMPose 1.x is based on [MMEngine](https://github.com/open-mmlab/mmengine), which provides a general and powerful runner that allows more flexible customizations and significantly simplifies the entrypoints of high-level interfaces.
1212

1313
- **Unified interfaces**. As a part of the OpenMMLab 2.x projects, MMPose 1.x unifies and refactors the interfaces and internal logics of train, testing, datasets, models, evaluation, and visualization. All the OpenMMLab 2.x projects share the same design in those interfaces and logics to allow the emergence of multi-task/modality algorithms.
1414

requirements/optional.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
poseval@git+https://github.com/svenkreiss/poseval.git
21
requests

requirements/poseval.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
poseval@git+https://github.com/svenkreiss/poseval.git

requirements/readthedocs.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
mmcv>=2.0.0rc1
22
mmengine
33
munkres
4-
poseval@git+https://github.com/svenkreiss/poseval.git
54
regex
65
scipy
76
titlecase

requirements/tests.txt

-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ isort==4.3.21
55
parameterized
66
pytest
77
pytest-runner
8-
smplx>=0.1.28
98
xdoctest>=0.10.0
109
yapf

setup.py

+64-73
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import os.path as osp
3+
import platform
34
import shutil
45
import sys
56
import warnings
@@ -13,67 +14,6 @@ def readme():
1314

1415

1516
version_file = 'mmpose/version.py'
16-
is_windows = sys.platform == 'win32'
17-
18-
19-
def add_mim_extention():
20-
"""Add extra files that are required to support MIM into the package.
21-
22-
These files will be added by creating a symlink to the originals if the
23-
package is installed in `editable` mode (e.g. pip install -e .), or by
24-
copying from the originals otherwise.
25-
"""
26-
27-
# parse installment mode
28-
if 'develop' in sys.argv:
29-
# installed by `pip install -e .`
30-
mode = 'symlink'
31-
elif 'sdist' in sys.argv or 'bdist_wheel' in sys.argv:
32-
# installed by `pip install .`
33-
# or create source distribution by `python setup.py sdist`
34-
mode = 'copy'
35-
else:
36-
return
37-
38-
filenames = ['tools', 'configs', 'model-index.yml']
39-
repo_path = osp.dirname(__file__)
40-
mim_path = osp.join(repo_path, 'mmpose', '.mim')
41-
os.makedirs(mim_path, exist_ok=True)
42-
43-
for filename in filenames:
44-
if osp.exists(filename):
45-
src_path = osp.join(repo_path, filename)
46-
tar_path = osp.join(mim_path, filename)
47-
48-
if osp.isfile(tar_path) or osp.islink(tar_path):
49-
os.remove(tar_path)
50-
elif osp.isdir(tar_path):
51-
shutil.rmtree(tar_path)
52-
53-
if mode == 'symlink':
54-
src_relpath = osp.relpath(src_path, osp.dirname(tar_path))
55-
try:
56-
os.symlink(src_relpath, tar_path)
57-
except OSError:
58-
# Creating a symbolic link on windows may raise an
59-
# `OSError: [WinError 1314]` due to privilege. If
60-
# the error happens, the src file will be copied
61-
mode = 'copy'
62-
warnings.warn(
63-
f'Failed to create a symbolic link for {src_relpath}, '
64-
f'and it will be copied to {tar_path}')
65-
else:
66-
continue
67-
68-
if mode == 'copy':
69-
if osp.isfile(src_path):
70-
shutil.copyfile(src_path, tar_path)
71-
elif osp.isdir(src_path):
72-
shutil.copytree(src_path, tar_path)
73-
else:
74-
warnings.warn(f'Cannot copy file {src_path}.')
75-
else:
76-
raise ValueError(f'Invalid mode {mode}')
7717

7818

7919
def get_version():
@@ -89,14 +29,16 @@ def get_version():
8929

9030

9131
def parse_requirements(fname='requirements.txt', with_version=True):
92-
"""Parse the package dependencies listed in a requirements file but strip
93-
specific version information.
32+
"""Parse the package dependencies listed in a requirements file but strips
33+
specific versioning information.
9434
9535
Args:
96-
fname (str): Path to requirements file.
97-
with_version (bool, default=False): If True, include version specs.
36+
fname (str): path to requirements file
37+
with_version (bool, default=False): if True include version specs
38+
9839
Returns:
99-
info (list[str]): List of requirements items.
40+
List[str]: list of requirements items
41+
10042
CommandLine:
10143
python -c "import setup; print(setup.parse_requirements())"
10244
"""
@@ -116,6 +58,8 @@ def parse_line(line):
11658
info = {'line': line}
11759
if line.startswith('-e '):
11860
info['package'] = line.split('#egg=')[1]
61+
elif '@git+' in line:
62+
info['package'] = line
11963
else:
12064
# Remove versioning from the package
12165
pat = '(' + '|'.join(['>=', '==', '>']) + ')'
@@ -162,12 +106,59 @@ def gen_packages_items():
162106
return packages
163107

164108

109+
def add_mim_extension():
110+
"""Add extra files that are required to support MIM into the package.
111+
112+
These files will be added by creating a symlink to the originals if the
113+
package is installed in `editable` mode (e.g. pip install -e .), or by
114+
copying from the originals otherwise.
115+
"""
116+
117+
# parse installment mode
118+
if 'develop' in sys.argv:
119+
# installed by `pip install -e .`
120+
if platform.system() == 'Windows':
121+
mode = 'copy'
122+
else:
123+
mode = 'symlink'
124+
elif 'sdist' in sys.argv or 'bdist_wheel' in sys.argv:
125+
# installed by `pip install .`
126+
# or create source distribution by `python setup.py sdist`
127+
mode = 'copy'
128+
else:
129+
return
130+
131+
filenames = ['tools', 'configs', 'demo', 'model-index.yml']
132+
repo_path = osp.dirname(__file__)
133+
mim_path = osp.join(repo_path, 'mmpose', '.mim')
134+
os.makedirs(mim_path, exist_ok=True)
135+
136+
for filename in filenames:
137+
if osp.exists(filename):
138+
src_path = osp.join(repo_path, filename)
139+
tar_path = osp.join(mim_path, filename)
140+
141+
if osp.isfile(tar_path) or osp.islink(tar_path):
142+
os.remove(tar_path)
143+
elif osp.isdir(tar_path):
144+
shutil.rmtree(tar_path)
145+
146+
if mode == 'symlink':
147+
src_relpath = osp.relpath(src_path, osp.dirname(tar_path))
148+
os.symlink(src_relpath, tar_path)
149+
elif mode == 'copy':
150+
if osp.isfile(src_path):
151+
shutil.copyfile(src_path, tar_path)
152+
elif osp.isdir(src_path):
153+
shutil.copytree(src_path, tar_path)
154+
else:
155+
warnings.warn(f'Cannot copy file {src_path}.')
156+
else:
157+
raise ValueError(f'Invalid mode {mode}')
158+
159+
165160
if __name__ == '__main__':
166-
add_mim_extention()
167-
library_dirs = [
168-
lp for lp in os.environ.get('LD_LIBRARY_PATH', '').split(':')
169-
if len(lp) > 1
170-
]
161+
add_mim_extension()
171162
setup(
172163
name='mmpose',
173164
version=get_version(),
@@ -197,7 +188,7 @@ def gen_packages_items():
197188
extras_require={
198189
'all': parse_requirements('requirements.txt'),
199190
'tests': parse_requirements('requirements/tests.txt'),
200-
'build': parse_requirements('requirements/build.txt'),
201-
'optional': parse_requirements('requirements/optional.txt')
191+
'optional': parse_requirements('requirements/optional.txt'),
192+
'mim': parse_requirements('requirements/mminstall.txt'),
202193
},
203194
zip_safe=False)

0 commit comments

Comments
 (0)