Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICV-mmengine_basecode
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Florian Schiffel
ICV-mmengine_basecode
Commits
3bdd27c4
Unverified
Commit
3bdd27c4
authored
3 years ago
by
liukuikun
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Fix] add required lib for vis (#111)
* add required lib for vis * fix comment
parent
98097bb7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
requirements/runtime.txt
+1
-0
1 addition, 0 deletions
requirements/runtime.txt
setup.py
+31
-1
31 additions, 1 deletion
setup.py
with
32 additions
and
1 deletion
requirements/runtime.txt
+
1
−
0
View file @
3bdd27c4
addict
addict
matplotlib
numpy
numpy
pyyaml
pyyaml
regex;sys_platform=='win32'
regex;sys_platform=='win32'
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
31
−
1
View file @
3bdd27c4
import
re
from
setuptools
import
find_packages
,
setup
# type: ignore
from
setuptools
import
find_packages
,
setup
# type: ignore
from
pkg_resources
import
DistributionNotFound
,
get_distribution
def
readme
():
def
readme
():
with
open
(
'
README.md
'
,
encoding
=
'
utf-8
'
)
as
f
:
with
open
(
'
README.md
'
,
encoding
=
'
utf-8
'
)
as
f
:
...
@@ -10,6 +13,18 @@ def readme():
...
@@ -10,6 +13,18 @@ def readme():
version_file
=
'
mmengine/version.py
'
version_file
=
'
mmengine/version.py
'
def
choose_requirement
(
primary
,
secondary
):
"""
If some version of primary requirement installed, return primary, else
return secondary.
"""
try
:
name
=
re
.
split
(
r
'
[!<>=]
'
,
primary
)[
0
]
get_distribution
(
name
)
except
DistributionNotFound
:
return
secondary
return
str
(
primary
)
def
get_version
():
def
get_version
():
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
'
))
...
@@ -92,6 +107,21 @@ def parse_requirements(fname='requirements/runtime.txt', with_version=True):
...
@@ -92,6 +107,21 @@ def parse_requirements(fname='requirements/runtime.txt', with_version=True):
return
packages
return
packages
install_requires
=
parse_requirements
()
try
:
# OpenCV installed via conda.
import
cv2
# NOQA: F401
major
,
minor
,
*
rest
=
cv2
.
__version__
.
split
(
'
.
'
)
if
int
(
major
)
<
3
:
raise
RuntimeError
(
f
'
OpenCV >=3 is required but
{
cv2
.
__version__
}
is installed
'
)
except
ImportError
:
# If first not installed install second package
CHOOSE_INSTALL_REQUIRES
=
[(
'
opencv-python-headless>=3
'
,
'
opencv-python>=3
'
)]
for
main
,
secondary
in
CHOOSE_INSTALL_REQUIRES
:
install_requires
.
append
(
choose_requirement
(
main
,
secondary
))
setup
(
setup
(
name
=
'
mmengine
'
,
name
=
'
mmengine
'
,
version
=
get_version
(),
version
=
get_version
(),
...
@@ -104,7 +134,7 @@ setup(
...
@@ -104,7 +134,7 @@ setup(
packages
=
find_packages
(),
packages
=
find_packages
(),
include_package_data
=
True
,
include_package_data
=
True
,
python_requires
=
'
>=3.6
'
,
python_requires
=
'
>=3.6
'
,
install_requires
=
parse_requirements
(
'
requirements/runtime.txt
'
)
,
install_requires
=
install_requires
,
extras_require
=
{
extras_require
=
{
'
all
'
:
parse_requirements
(
'
requirements.txt
'
),
'
all
'
:
parse_requirements
(
'
requirements.txt
'
),
'
tests
'
:
parse_requirements
(
'
requirements/tests.txt
'
),
'
tests
'
:
parse_requirements
(
'
requirements/tests.txt
'
),
...
...
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