Commit 2b2eeb3b authored by Samuel GAIST's avatar Samuel GAIST

Merge branch 'remove_use_of_oset' into 'master'

Remove use of oset

The oset package triggers a warning with Python 3.7 that
if not fixed will make the package not working with
Python 3.8.

After some testing, the use of Python standard sets
seems to be enough for the needs of beat/beat.cmdline>.

Therefore remove oset.

See merge request !71
parents 97a7e1f0 ecf89213
Pipeline #33204 canceled with stages
in 6 seconds
...@@ -45,7 +45,6 @@ import collections ...@@ -45,7 +45,6 @@ import collections
import logging import logging
import six import six
import oset
import termcolor import termcolor
import simplejson import simplejson
...@@ -376,11 +375,9 @@ def make_up_remote_list(webapi, asset_type, requirements): ...@@ -376,11 +375,9 @@ def make_up_remote_list(webapi, asset_type, requirements):
if short_requirements: if short_requirements:
if candidates is None: if candidates is None:
return None return None
retval = oset.oset() retval = set()
for name in short_requirements: for name in short_requirements:
retval |= oset.oset( retval |= set([k["name"] for k in candidates if k["name"].find(name) != -1])
[k["name"] for k in candidates if k["name"].find(name) != -1]
)
retval = list(retval) retval = list(retval)
logger.info("search strings matched %d remote object(s)", len(retval)) logger.info("search strings matched %d remote object(s)", len(retval))
...@@ -485,9 +482,9 @@ def make_up_local_list(prefix, asset_type, requirements): ...@@ -485,9 +482,9 @@ def make_up_local_list(prefix, asset_type, requirements):
full_requirements = fnmatch.filter(requirements, TYPE_FNMATCH[asset_type]) full_requirements = fnmatch.filter(requirements, TYPE_FNMATCH[asset_type])
short_requirements = [k for k in requirements if k not in full_requirements] short_requirements = [k for k in requirements if k not in full_requirements]
retval = oset.oset() retval = set()
for name in short_requirements: for name in short_requirements:
retval |= oset.oset([k for k in candidates if k.startswith(name)]) retval |= set([k for k in candidates if k.startswith(name)])
# note: if you specify a full-length requirement, we don't really care if it # note: if you specify a full-length requirement, we don't really care if it
# is there or not. The final command will decide if it is an error. # is there or not. The final command will decide if it is an error.
...@@ -894,7 +891,7 @@ def pull(webapi, prefix, asset_type, names, fields, force, indentation): ...@@ -894,7 +891,7 @@ def pull(webapi, prefix, asset_type, names, fields, force, indentation):
if not names: if not names:
return 1, [] return 1, []
indent = indentation * " " indent = indentation * " "
available = oset.oset() available = set()
status = 0 status = 0
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
import logging import logging
import click import click
import oset
from beat.core import dataformat from beat.core import dataformat
...@@ -91,8 +89,8 @@ def pull_impl(webapi, prefix, names, force, indentation, cache): ...@@ -91,8 +89,8 @@ def pull_impl(webapi, prefix, names, force, indentation, cache):
""" """
dataformats = oset.oset(names) # what is being request dataformats = set(names) # what is being request
download = dataformats - oset.oset(cache.keys()) # what we actually need download = dataformats - set(cache.keys()) # what we actually need
if not download: if not download:
return 0 return 0
......
...@@ -38,7 +38,6 @@ import os ...@@ -38,7 +38,6 @@ import os
import logging import logging
import glob import glob
import click import click
import oset
import simplejson import simplejson
from beat.core.experiment import Experiment from beat.core.experiment import Experiment
...@@ -441,9 +440,9 @@ def pull_impl(webapi, prefix, names, force, indentation, format_cache): ...@@ -441,9 +440,9 @@ def pull_impl(webapi, prefix, names, force, indentation, format_cache):
return status return status
# see what dataformats one needs to pull # see what dataformats one needs to pull
databases = oset.oset() databases = set()
toolchains = oset.oset() toolchains = set()
algorithms = oset.oset() algorithms = set()
for name in names: for name in names:
try: try:
obj = Experiment(prefix, name) obj = Experiment(prefix, name)
......
...@@ -75,7 +75,6 @@ Options: ...@@ -75,7 +75,6 @@ Options:
import logging import logging
import click import click
import oset
from beat.core import library from beat.core import library
...@@ -124,8 +123,8 @@ def pull_impl(webapi, prefix, names, force, indentation, cache): ...@@ -124,8 +123,8 @@ def pull_impl(webapi, prefix, names, force, indentation, cache):
""" """
libraries = oset.oset(names) # what is being request libraries = set(names) # what is being request
download = libraries - oset.oset(cache.keys()) # what we actually need download = libraries - set(cache.keys()) # what we actually need
if not download: if not download:
return 0 return 0
......
...@@ -42,7 +42,6 @@ requirements: ...@@ -42,7 +42,6 @@ requirements:
- beat.backend.python - beat.backend.python
- beat.core - beat.core
- termcolor - termcolor
- oset
- docopt - docopt
- click - click
- click-plugins - click-plugins
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment