Skip to content

Commit dfed07d

Browse files
authored
Merge pull request #141 from animesh-007/pypi-fix
added fix
2 parents 34cb6eb + ee8528e commit dfed07d

File tree

3 files changed

+2
-62
lines changed

3 files changed

+2
-62
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
uses: actions/setup-python@v4
1313
with:
1414
python-version: 3.7
15-
- name: Build MMPretrain
15+
- name: Build TrAILMET
1616
run: |
1717
pip install wheel
1818
python setup.py sdist bdist_wheel

setup.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -119,66 +119,6 @@ def gen_packages_items():
119119
return packages
120120

121121

122-
def add_mim_extension():
123-
"""Add extra files that are required to support MIM into the package.
124-
125-
These files will be added by creating a symlink to the originals if the
126-
package is installed in `editable` mode (e.g. pip install -e .), or by
127-
copying from the originals otherwise.
128-
"""
129-
130-
# parse installment mode
131-
if 'develop' in sys.argv:
132-
# installed by `pip install -e .`
133-
mode = 'symlink'
134-
elif 'sdist' in sys.argv or 'bdist_wheel' in sys.argv:
135-
# installed by `pip install .`
136-
# or create source distribution by `python setup.py sdist`
137-
mode = 'copy'
138-
else:
139-
return
140-
141-
filenames = ['tools', 'configs', 'model-index.yml']
142-
repo_path = osp.dirname(__file__)
143-
mim_path = osp.join(repo_path, 'mmpretrain', '.mim')
144-
os.makedirs(mim_path, exist_ok=True)
145-
146-
for filename in filenames:
147-
if osp.exists(filename):
148-
src_path = osp.join(repo_path, filename)
149-
tar_path = osp.join(mim_path, filename)
150-
151-
if osp.isfile(tar_path) or osp.islink(tar_path):
152-
os.remove(tar_path)
153-
elif osp.isdir(tar_path):
154-
shutil.rmtree(tar_path)
155-
156-
if mode == 'symlink':
157-
src_relpath = osp.relpath(src_path, osp.dirname(tar_path))
158-
try:
159-
os.symlink(src_relpath, tar_path)
160-
except OSError:
161-
# Creating a symbolic link on windows may raise an
162-
# `OSError: [WinError 1314]` due to privilege. If
163-
# the error happens, the src file will be copied
164-
mode = 'copy'
165-
warnings.warn(
166-
f'Failed to create a symbolic link for {src_relpath}, '
167-
f'and it will be copied to {tar_path}')
168-
else:
169-
continue
170-
171-
if mode == 'copy':
172-
if osp.isfile(src_path):
173-
shutil.copyfile(src_path, tar_path)
174-
elif osp.isdir(src_path):
175-
shutil.copytree(src_path, tar_path)
176-
else:
177-
warnings.warn(f'Cannot copy file {src_path}.')
178-
else:
179-
raise ValueError(f'Invalid mode {mode}')
180-
181-
182122
if __name__ == '__main__':
183123
setup(name='trailmet',
184124
version=get_version(),

trailmet/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22-
__version__ = '0.0.1rc'
22+
__version__ = '0.0.1rc2'
2323

2424

2525
def parse_version_info(version_str):

0 commit comments

Comments
 (0)