Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
food-round2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joel Joseph
food-round2
Commits
4c376e58
Commit
4c376e58
authored
6 years ago
by
Kai Chen
Browse files
Options
Downloads
Patches
Plain Diff
add git hash to version info
parent
300f7157
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mmdet/__init__.py
+1
-1
1 addition, 1 deletion
mmdet/__init__.py
mmdet/version.py
+0
-1
0 additions, 1 deletion
mmdet/version.py
setup.py
+93
-25
93 additions, 25 deletions
setup.py
with
94 additions
and
27 deletions
mmdet/__init__.py
+
1
−
1
View file @
4c376e58
from
.version
import
__version__
from
.version
import
__version__
,
short_version
This diff is collapsed.
Click to expand it.
mmdet/version.py
deleted
100644 → 0
+
0
−
1
View file @
300f7157
__version__
=
'
0.5.0
'
This diff is collapsed.
Click to expand it.
setup.py
+
93
−
25
View file @
4c376e58
import
os
import
subprocess
import
time
from
setuptools
import
find_packages
,
setup
from
setuptools
import
find_packages
,
setup
...
@@ -7,34 +10,99 @@ def readme():
...
@@ -7,34 +10,99 @@ def readme():
return
content
return
content
MAJOR
=
0
MINOR
=
5
PATCH
=
0
SUFFIX
=
''
SHORT_VERSION
=
'
{}.{}.{}{}
'
.
format
(
MAJOR
,
MINOR
,
PATCH
,
SUFFIX
)
version_file
=
'
mmdet/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
mmdet.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 =
'
{}
'
"""
sha
=
get_hash
()
VERSION
=
SHORT_VERSION
+
'
+
'
+
sha
with
open
(
version_file
,
'
w
'
)
as
f
:
f
.
write
(
content
.
format
(
time
.
asctime
(),
VERSION
,
SHORT_VERSION
))
def
get_version
():
def
get_version
():
version_file
=
'
mmdet/version.py
'
with
open
(
version_file
,
'
r
'
)
as
f
:
with
open
(
version_file
,
'
r
'
)
as
f
:
exec
(
compile
(
f
.
read
(),
version_file
,
'
exec
'
))
exec
(
compile
(
f
.
read
(),
version_file
,
'
exec
'
))
return
locals
()[
'
__version__
'
]
return
locals
()[
'
__version__
'
]
setup
(
if
__name__
==
'
__main__
'
:
name
=
'
mmdet
'
,
write_version_py
()
version
=
get_version
(),
setup
(
description
=
'
Open MMLab Detection Toolbox
'
,
name
=
'
mmdet
'
,
long_description
=
readme
(),
version
=
get_version
(),
keywords
=
'
computer vision, object detection
'
,
description
=
'
Open MMLab Detection Toolbox
'
,
packages
=
find_packages
(),
long_description
=
readme
(),
classifiers
=
[
keywords
=
'
computer vision, object detection
'
,
'
Development Status :: 4 - Beta
'
,
packages
=
find_packages
(),
'
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
'
,
classifiers
=
[
'
Operating System :: OS Independent
'
,
'
Development Status :: 4 - Beta
'
,
'
Programming Language :: Python :: 2
'
,
'
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
'
,
'
Programming Language :: Python :: 2.7
'
,
'
Operating System :: OS Independent
'
,
'
Programming Language :: Python :: 3
'
,
'
Programming Language :: Python :: 2
'
,
'
Programming Language :: Python :: 3.4
'
,
'
Programming Language :: Python :: 2.7
'
,
'
Programming Language :: Python :: 3.5
'
,
'
Programming Language :: Python :: 3
'
,
'
Programming Language :: Python :: 3.6
'
,
'
Programming Language :: Python :: 3.4
'
,
'
Topic :: Utilities
'
,
'
Programming Language :: Python :: 3.5
'
,
],
'
Programming Language :: Python :: 3.6
'
,
license
=
'
GPLv3
'
,
'
Topic :: Utilities
'
,
setup_requires
=
[
'
pytest-runner
'
],
],
tests_require
=
[
'
pytest
'
],
license
=
'
GPLv3
'
,
install_requires
=
[
'
numpy
'
,
'
matplotlib
'
,
'
six
'
,
'
terminaltables
'
],
setup_requires
=
[
'
pytest-runner
'
],
zip_safe
=
False
)
tests_require
=
[
'
pytest
'
],
install_requires
=
[
'
numpy
'
,
'
matplotlib
'
,
'
six
'
,
'
terminaltables
'
],
zip_safe
=
False
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment