Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
48011e56
Unverified
Commit
48011e56
authored
Sep 18, 2020
by
Wenwei Zhang
Committed by
GitHub
Sep 18, 2020
Browse files
update version.py (#112)
parent
b684c1d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
67 deletions
+19
-67
.gitignore
.gitignore
+0
-2
mmdet3d/VERSION
mmdet3d/VERSION
+0
-1
mmdet3d/version.py
mmdet3d/version.py
+19
-0
setup.py
setup.py
+0
-64
No files found.
.gitignore
View file @
48011e56
...
...
@@ -105,8 +105,6 @@ venv.bak/
.mypy_cache/
# cython generated cpp
mmdet3d/ops/nms/src/soft_nms_cpu.cpp
mmdet3d/version.py
data
.vscode
.idea
...
...
mmdet3d/VERSION
deleted
100644 → 0
View file @
b684c1d5
0.5.0
mmdet3d/version.py
0 → 100644
View file @
48011e56
# Copyright (c) Open-MMLab. All rights reserved.
__version__
=
'0.5.0'
short_version
=
__version__
def
parse_version_info
(
version_str
):
version_info
=
[]
for
x
in
version_str
.
split
(
'.'
):
if
x
.
isdigit
():
version_info
.
append
(
int
(
x
))
elif
x
.
find
(
'rc'
)
!=
-
1
:
patch_version
=
x
.
split
(
'rc'
)
version_info
.
append
(
int
(
patch_version
[
0
]))
version_info
.
append
(
f
'rc
{
patch_version
[
1
]
}
'
)
return
tuple
(
version_info
)
version_info
=
parse_version_info
(
__version__
)
setup.py
View file @
48011e56
from
setuptools
import
find_packages
,
setup
import
os
import
subprocess
import
time
import
torch
from
torch.utils.cpp_extension
import
(
BuildExtension
,
CppExtension
,
CUDAExtension
)
...
...
@@ -17,67 +15,6 @@ def readme():
version_file
=
'mmdet3d/version.py'
def
get_git_hash
():
def
_minimal_ext_cmd
(
cmd
):
# construct minimal environment
env
=
{}
for
k
in
[
'SYSTEMROOT'
,
'PATH'
,
'HOME'
]:
v
=
os
.
environ
.
get
(
k
)
if
v
is
not
None
:
env
[
k
]
=
v
# LANGUAGE is used on win32
env
[
'LANGUAGE'
]
=
'C'
env
[
'LANG'
]
=
'C'
env
[
'LC_ALL'
]
=
'C'
out
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
env
=
env
).
communicate
()[
0
]
return
out
try
:
out
=
_minimal_ext_cmd
([
'git'
,
'rev-parse'
,
'HEAD'
])
sha
=
out
.
strip
().
decode
(
'ascii'
)
except
OSError
:
sha
=
'unknown'
return
sha
def
get_hash
():
if
os
.
path
.
exists
(
'.git'
):
sha
=
get_git_hash
()[:
7
]
elif
os
.
path
.
exists
(
version_file
):
try
:
from
mmdet3d.version
import
__version__
sha
=
__version__
.
split
(
'+'
)[
-
1
]
except
ImportError
:
raise
ImportError
(
'Unable to get git version'
)
else
:
sha
=
'unknown'
return
sha
def
write_version_py
():
content
=
"""# GENERATED VERSION FILE
# TIME: {}
__version__ = '{}'
short_version = '{}'
version_info = ({})
"""
sha
=
get_hash
()
with
open
(
'mmdet3d/VERSION'
,
'r'
)
as
f
:
SHORT_VERSION
=
f
.
read
().
strip
()
VERSION_INFO
=
', '
.
join
(
[
x
if
x
.
isdigit
()
else
f
'"
{
x
}
"'
for
x
in
SHORT_VERSION
.
split
(
'.'
)])
VERSION
=
SHORT_VERSION
+
'+'
+
sha
version_file_str
=
content
.
format
(
time
.
asctime
(),
VERSION
,
SHORT_VERSION
,
VERSION_INFO
)
with
open
(
version_file
,
'w'
)
as
f
:
f
.
write
(
version_file_str
)
def
get_version
():
with
open
(
version_file
,
'r'
)
as
f
:
exec
(
compile
(
f
.
read
(),
version_file
,
'exec'
))
...
...
@@ -199,7 +136,6 @@ def parse_requirements(fname='requirements.txt', with_version=True):
if
__name__
==
'__main__'
:
write_version_py
()
setup
(
name
=
'mmdet3d'
,
version
=
get_version
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment