Skip to content

Commit

Permalink
Merge pull request #167 from Exopy/py38
Browse files Browse the repository at this point in the history
Start testing on Python 3.8
  • Loading branch information
MatthieuDartiailh committed Jun 25, 2020
2 parents 9fada3c + 1634ee0 commit 68633bd
Show file tree
Hide file tree
Showing 75 changed files with 255 additions and 257 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -52,3 +52,4 @@ docs/build
.spyderproject
.spyderworkspace
.spyproject
.vscode
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -10,9 +10,9 @@ branches:

matrix:
include:
- env: PYTHON=3.5 CONDA_PY=35 QT_VERSION=5
- env: PYTHON=3.6 CONDA_PY=36 QT_VERSION=5
- env: PYTHON=3.7 CONDA_PY=37 QT_VERSION=5
- env: PYTHON=3.8 CONDA_PY=38 QT_VERSION=5

before_install:

Expand All @@ -25,6 +25,7 @@ before_install:
# Setup environment
- travis_retry conda update --yes conda
- conda config --set always_yes yes
- conda config --append channels conda-forge
- conda config --append channels exopy
- conda install conda-build anaconda-client -q
- conda info -a
Expand All @@ -40,7 +41,7 @@ before_install:
- export CONDA_BLD_PATH=$(pwd)

# Install exopy dependencies
- $CONDA_INSTALL pyqt=$QT_VERSION numpy configobj watchdog enaml>=0.10.2 qtawesome pyvisa
- $CONDA_INSTALL pyqt=$QT_VERSION numpy configobj watchdog qtawesome pyvisa enaml>=0.11.0

# Intall test tools
- $CONDA_INSTALL pytest
Expand Down
4 changes: 0 additions & 4 deletions docs/source/dev_guide/atom_enaml.rst
Expand Up @@ -15,10 +15,6 @@ duck-typing but tends to make the code easier to read. Note also that metadata
can be added to a member using the :py:meth:tag method. Metadata are
extensively used in Exopy.

.. note::

For clarity sake and Python2/3 compatibility, Unicode should be used
instead of Str.

Enaml
-----
Expand Down
12 changes: 6 additions & 6 deletions docs/source/dev_guide/tasks.rst
Expand Up @@ -61,7 +61,7 @@ used to identify the part to replace with the value stored in the database).
my_int = Int(1).tag(pref=True) # Integer with a default value of 1
#: my_text description
my_text = Unicode().tag(pref=True)
my_text = Str().tag(pref=True)
Tasks use a common database (which is nothing else that a kind of smart
dictionary) to exchange data. If a task needs to write a value in the database
Expand Down Expand Up @@ -123,12 +123,12 @@ simply need to tag the concerned member with 'fmt' (formatting only) or 'feval'
"""MyTask description.
"""
value1 = Unicode().tag(feval=v.Feval(types=numbers.Real,
value1 = Str().tag(feval=v.Feval(types=numbers.Real,
warn=True))
value2 = Unicode().tag(feval=v.SkipEmpty())
value2 = Str().tag(feval=v.SkipEmpty())
value3 = Unicode().tag(feval=v.SkipLoop())
value3 = Str().tag(feval=v.SkipLoop())
In the above example :

Expand Down Expand Up @@ -370,7 +370,7 @@ implemented and the handling of the database use the same members.

.. code-block:: python
from atom.api import Unicode, Int
from atom.api import Str, Int
class MyInterface(TaskInterface):
"""MyInterface description.
Expand All @@ -382,7 +382,7 @@ implemented and the handling of the database use the same members.
my_int = Int(1).tag(pref=True) # Integer with a default value of 1
#: my_text description
my_text = Unicode().tag(pref=True)
my_text = Str().tag(pref=True)
database_entries = set_default({'val': 1})
Expand Down
8 changes: 4 additions & 4 deletions exopy/app/app_extensions.py
Expand Up @@ -9,7 +9,7 @@
"""App plugin extensions declarations.
"""
from atom.api import Unicode, Int
from atom.api import Str, Int
from enaml.core.api import Declarative, d_, d_func


Expand All @@ -22,7 +22,7 @@ class AppStartup(Declarative):
"""
#: The globally unique identifier for the start-up.
id = d_(Unicode())
id = d_(Str())

#: The priority determine the order in which AppStartup are called. The
#: **lowest** this number the sooner the object will be called. Two
Expand Down Expand Up @@ -64,7 +64,7 @@ class AppClosing(Declarative):
"""
#: The globally unique identifier for the closing.
id = d_(Unicode())
id = d_(Str())

@d_func
def validate(self, window, event):
Expand Down Expand Up @@ -107,7 +107,7 @@ class AppClosed(Declarative):
"""
#: The globally unique identifier for the closing.
id = d_(Unicode())
id = d_(Str())

#: The priority determine the order in which AppClosed are called. The
#: **lowest** this number the sooner the object will be called. Two
Expand Down
10 changes: 5 additions & 5 deletions exopy/app/dependencies/dependencies.py
Expand Up @@ -16,7 +16,7 @@
also drivers classes and intsrument profiles (runtime)
"""
from atom.api import (Unicode)
from atom.api import (Str)
from enaml.core.api import Declarative, d_, d_func


Expand All @@ -31,7 +31,7 @@ class BuildDependency(Declarative):
"""
#: Unique id for this extension. Should match the dep_type attribute value
#: of the object it is meant for.
id = d_(Unicode())
id = d_(Str())

@d_func
def analyse(self, workbench, obj, getter, dependencies, errors):
Expand Down Expand Up @@ -125,11 +125,11 @@ class RuntimeDependencyAnalyser(Declarative):
"""
#: Unique id for this extension.
id = d_(Unicode())
id = d_(Str())

#: Id of the collector that should be used to collect the dependencies
#: discovered during analysis.
collector_id = d_(Unicode())
collector_id = d_(Str())

@d_func
def analyse(self, workbench, obj, dependencies, errors):
Expand Down Expand Up @@ -164,7 +164,7 @@ class RuntimeDependencyCollector(Declarative):
"""
#: Unique id for this extension.
id = d_(Unicode())
id = d_(Str())

@d_func
def validate(self, workbench, dependencies, errors):
Expand Down
6 changes: 3 additions & 3 deletions exopy/app/errors/errors.py
Expand Up @@ -9,7 +9,7 @@
"""Declarations for the extensions to the error plugin.
"""
from atom.api import Unicode
from atom.api import Str
from enaml.core.api import Declarative, d_, d_func


Expand All @@ -18,11 +18,11 @@ class ErrorHandler(Declarative):
"""
#: Id of the error. When signaling errors it will referred to as the kind.
id = d_(Unicode())
id = d_(Str())

#: Short description of what this handler can do. The keyword for the
#: handle method should be specified.
description = d_(Unicode())
description = d_(Str())

@d_func
def handle(self, workbench, infos):
Expand Down
10 changes: 5 additions & 5 deletions exopy/app/icons/icon_theme.py
Expand Up @@ -9,7 +9,7 @@
"""Extension objects to the icon plugin.
"""
from atom.api import Unicode, Dict, List
from atom.api import Str, Dict, List
from enaml.core.api import Declarative, d_, d_func


Expand All @@ -25,7 +25,7 @@ class IconTheme(Declarative):
"""
#: Unique id of the icon theme.
id = d_(Unicode())
id = d_(Str())

@d_func
def get_icon(self, manager, icon_id):
Expand Down Expand Up @@ -77,10 +77,10 @@ class IconThemeExtension(Declarative):
"""
#: Unicsue id of the extension.
id = d_(Unicode())
id = d_(Str())

#: Id of the icon theme to which to contribute the children Icon objects.
theme = d_(Unicode())
theme = d_(Str())

def icons(self):
"""List the associated icons.
Expand All @@ -103,7 +103,7 @@ class Icon(Declarative):
"""
#: Unique id describing the icon. It should provide a clear description
#: of the icon purpose.
id = d_(Unicode())
id = d_(Str())

@d_func
def get_icon(self, manager, theme):
Expand Down
6 changes: 3 additions & 3 deletions exopy/app/icons/plugin.py
Expand Up @@ -11,7 +11,7 @@
"""
import logging

from atom.api import List, Typed, Unicode
from atom.api import List, Typed, Str

from .icon_theme import IconTheme, IconThemeExtension
from ...utils.traceback import format_exc
Expand All @@ -29,11 +29,11 @@ class IconManagerPlugin(HasPreferencesPlugin):
"""
#: Id of the currently selected icon theme
current_theme = Unicode('exopy.FontAwesome').tag(pref=True)
current_theme = Str('exopy.FontAwesome').tag(pref=True)

#: Id of the icon theme to use as fallback if a theme fail to provide an
#: icon.
fallback_theme = Unicode('exopy.FontAwesome').tag(pref=True)
fallback_theme = Str('exopy.FontAwesome').tag(pref=True)

#: Registered icon themes ids
icon_themes = List()
Expand Down
10 changes: 5 additions & 5 deletions exopy/app/log/plugin.py
Expand Up @@ -12,7 +12,7 @@
import os
import logging

from atom.api import Unicode, Dict, List, Tuple, Typed
from atom.api import Str, Dict, List, Tuple, Typed
from enaml.workbench.api import Plugin

from .tools import (LogModel, GuiHandler, DayRotatingTimeHandler)
Expand All @@ -30,10 +30,10 @@ class LogPlugin(Plugin):
"""
#: List of installed handlers.
handler_ids = List(Unicode())
handler_ids = List(Str())

#: List of installed filters.
filter_ids = List(Unicode())
filter_ids = List(Str())

#: Model which can be used to display the log in the GUI. It is associated
#: to a handler attached to the root logger.
Expand Down Expand Up @@ -197,7 +197,7 @@ def set_formatter(self, handler_id, formatter):
# ---- Private API --------------------------------------------------------

# Mapping between handler ids and handler, logger name pairs.
_handlers = Dict(Unicode(), Tuple())
_handlers = Dict(Str(), Tuple())

# Mapping between filter_id and filter, handler_id pairs.
_filters = Dict(Unicode(), Tuple())
_filters = Dict(Str(), Tuple())
4 changes: 2 additions & 2 deletions exopy/app/log/tools.py
Expand Up @@ -32,7 +32,7 @@
from logging.handlers import TimedRotatingFileHandler
from threading import Thread
from enaml.application import deferred_call
from atom.api import Atom, Unicode, Int
from atom.api import Atom, Str, Int
import codecs


Expand Down Expand Up @@ -199,7 +199,7 @@ class LogModel(Atom):
"""
#: Text representing all the messages sent by the handler.
#: Should not be altered by user code.
text = Unicode()
text = Str()

#: Maximum number of lines.
buff_size = Int(1000)
Expand Down
6 changes: 3 additions & 3 deletions exopy/app/preferences/plugin.py
Expand Up @@ -10,7 +10,7 @@
"""
import os
from atom.api import Unicode, Typed, Dict
from atom.api import Str, Typed, Dict
from enaml.workbench.api import Plugin
from configobj import ConfigObj
from functools import partial
Expand All @@ -29,10 +29,10 @@ class PrefPlugin(Plugin):
"""
#: Folder used by the application to store informations such as preferences
#: log files, ...
app_directory = Unicode()
app_directory = Str()

#: Path of the last location visited using a dialog.
last_directory = Unicode()
last_directory = Str()

def start(self):
"""Start the plugin, locate app folder and load default preferences.
Expand Down
6 changes: 3 additions & 3 deletions exopy/app/preferences/preferences.py
Expand Up @@ -9,7 +9,7 @@
"""Declarative class for defining hnadling of preferences.
"""
from atom.api import List, Unicode
from atom.api import List, Str
from enaml.core.api import Declarative, d_, d_func


Expand All @@ -22,11 +22,11 @@ class Preferences(Declarative):
"""
#: Name of the method of the plugin contributing this extension to call
#: when the preference plugin need to save the preferences.
saving_method = d_(Unicode('preferences_from_members'))
saving_method = d_(Str('preferences_from_members'))

#: Name of the method of the plugin contributing this extension to call
#: when the preference plugin need to load preferences.
loading_method = d_(Unicode('update_members_from_preferences'))
loading_method = d_(Str('update_members_from_preferences'))

#: The list of plugin members whose values should be observed and whose
#: update should cause and automatic update of the preferences.
Expand Down
8 changes: 4 additions & 4 deletions exopy/app/states/state.py
Expand Up @@ -9,7 +9,7 @@
"""State plugin extension declaration.
"""
from atom.api import (List, Unicode)
from atom.api import (List, Str)
from enaml.core.api import Declarative, d_


Expand All @@ -21,11 +21,11 @@ class State(Declarative):
"""
#: The globally unique identifier for the state
id = d_(Unicode())
id = d_(Str())

#: An optional description of what the state provides.
description = d_(Unicode())
description = d_(Str())

#: The list of plugin members whose values should be reflected in the
#: state object
sync_members = d_(List(Unicode()))
sync_members = d_(List(Str()))
6 changes: 3 additions & 3 deletions exopy/instruments/connections/base_connection.py
Expand Up @@ -14,7 +14,7 @@
starter used to instantiate the driver.
"""
from atom.api import Unicode, ForwardTyped, Bool
from atom.api import Str, ForwardTyped, Bool
from enaml.core.api import d_, Declarative, d_func
from enaml.widgets.api import GroupBox

Expand Down Expand Up @@ -45,10 +45,10 @@ class Connection(Declarative):
"""
#: Unique name used to identify the connection.
id = d_(Unicode())
id = d_(Str())

#: Connection description.
description = d_(Unicode())
description = d_(Str())

@d_func
def new(self, workbench, defaults, read_only):
Expand Down

0 comments on commit 68633bd

Please sign in to comment.