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
import logging
import six
import oset
import termcolor
import simplejson
......@@ -376,11 +375,9 @@ def make_up_remote_list(webapi, asset_type, requirements):
if short_requirements:
if candidates is None:
return None
retval = oset.oset()
retval = set()
for name in short_requirements:
retval |= oset.oset(
[k["name"] for k in candidates if k["name"].find(name) != -1]
)
retval |= set([k["name"] for k in candidates if k["name"].find(name) != -1])
retval = list(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):
full_requirements = fnmatch.filter(requirements, TYPE_FNMATCH[asset_type])
short_requirements = [k for k in requirements if k not in full_requirements]
retval = oset.oset()
retval = set()
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
# 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):
if not names:
return 1, []
indent = indentation * " "
available = oset.oset()
available = set()
status = 0
......
......@@ -37,8 +37,6 @@
import logging
import click
import oset
from beat.core import dataformat
......@@ -91,8 +89,8 @@ def pull_impl(webapi, prefix, names, force, indentation, cache):
"""
dataformats = oset.oset(names) # what is being request
download = dataformats - oset.oset(cache.keys()) # what we actually need
dataformats = set(names) # what is being request
download = dataformats - set(cache.keys()) # what we actually need
if not download:
return 0
......
......@@ -38,7 +38,6 @@ import os
import logging
import glob
import click
import oset
import simplejson
from beat.core.experiment import Experiment
......@@ -441,9 +440,9 @@ def pull_impl(webapi, prefix, names, force, indentation, format_cache):
return status
# see what dataformats one needs to pull
databases = oset.oset()
toolchains = oset.oset()
algorithms = oset.oset()
databases = set()
toolchains = set()
algorithms = set()
for name in names:
try:
obj = Experiment(prefix, name)
......
......@@ -75,7 +75,6 @@ Options:
import logging
import click
import oset
from beat.core import library
......@@ -124,8 +123,8 @@ def pull_impl(webapi, prefix, names, force, indentation, cache):
"""
libraries = oset.oset(names) # what is being request
download = libraries - oset.oset(cache.keys()) # what we actually need
libraries = set(names) # what is being request
download = libraries - set(cache.keys()) # what we actually need
if not download:
return 0
......
......@@ -42,7 +42,6 @@ requirements:
- beat.backend.python
- beat.core
- termcolor
- oset
- docopt
- click
- 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