Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.7: 4 syntax errors and 33 undefined names #2031

Closed
cclauss opened this issue Oct 6, 2018 · 0 comments · Fixed by #2094
Closed

Python 3.7: 4 syntax errors and 33 undefined names #2031

cclauss opened this issue Oct 6, 2018 · 0 comments · Fixed by #2094
Assignees

Comments

@cclauss
Copy link

cclauss commented Oct 6, 2018

#2025 accidentally closed #1992 without running the test to see if the work was complete.

The four Python 3.7 syntax errors are discussed in #1994.

flake8 testing of https://github.com/aiidateam/aiida_core on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./.ci/test_daemon.py:77:62: F821 undefined name 'e'
        print("Note: the command failed, message: {}".format(e))
                                                             ^
./.ci/test_daemon.py:243:35: F821 undefined name 'CalculationFactory'
    TemplatereplacerCalculation = CalculationFactory('simpleplugins.templatereplacer')
                                  ^
./.ci/test_daemon.py:294:12: F821 undefined name 'Code'
    code = Code.get_from_string(codename)
           ^
./examples/wf_submission/wf_XTiO3_example.py:29:11: F821 undefined name 'DataFactory'
UpfData = DataFactory('upf')
          ^
./examples/wf_submission/wf_XTiO3_example.py:60:8: F821 undefined name 'NotExistent'
except NotExistent:
       ^
./examples/wf_submission/wf_XTiO3_example.py:67:17: F821 undefined name 'DataFactory'
ParameterData = DataFactory('parameter')
                ^
./examples/work/scratch.py:55:44: F821 undefined name 'StructureData'
        spec.input("structure", valid_type=StructureData)
                                           ^
./examples/work/scratch.py:72:28: F821 undefined name 'Calc'
        return ToContext(r=Calc(1234), s=Outputs(1234))
                           ^
./examples/work/scratch.py:86:44: F821 undefined name 'StructureData'
        spec.input("structure", valid_type=StructureData)
                                           ^
./examples/work/scratch.py:101:33: F821 undefined name 'Calc'
            self.insert_barrier(Calc(pid))
                                ^
./examples/work/scratch.py:105:25: F821 undefined name 'load_node'
            self.out(s, load_node(pid)['output_parameters'].dict)
                        ^
./aiida/common/orbital/__init__.py:170:12: F821 undefined name 'BaseFactory'
    return BaseFactory('aiida.common.orbital', entry_point)
           ^
./aiida/work/rmq.py:375:32: E999 SyntaxError: invalid syntax
        self._communicator.await(action, timeout=self.timeout)
                               ^
./aiida/backends/sqlalchemy/models/workflow.py:240:24: F821 undefined name 'model'
            instance = model(**params)
                       ^
./aiida/backends/sqlalchemy/models/workflow.py:241:13: F821 undefined name 'session'
            session.add(instance)
            ^
./aiida/backends/djsite/db/models.py:975:38: F821 undefined name 'e'
            exc.original_exception = e
                                     ^
./aiida/backends/djsite/db/models.py:1114:38: F821 undefined name 'e'
            exc.original_exception = e
                                     ^
./aiida/backends/tests/nodes.py:1377:44: F821 undefined name 'long'
            a3 = Node.get_subclass_from_pk(long(a1.id))
                                           ^
./aiida/backends/tests/work/test_workfunctions.py:145:34: F821 undefined name 'INPUT'
        KWARGS_INPUT = {'b': Int(INPUT)}
                                 ^
./aiida/backends/tests/orm/data/remote.py:52:27: F821 undefined name 'the_path'
                os.remove(the_path)
                          ^
./aiida/utils/queries.py:55:15: F821 undefined name 'InputValidationError'
        raise InputValidationError(
              ^
./aiida/utils/cli/__init__.py:24:9: F821 undefined name 'func'
        func(*args, **kwargs)
        ^
./aiida/utils/cli/__init__.py:24:15: F821 undefined name 'args'
        func(*args, **kwargs)
              ^
./aiida/utils/cli/__init__.py:24:23: F821 undefined name 'kwargs'
        func(*args, **kwargs)
                      ^
./aiida/restapi/translator/data/kpoints.py:137:38: F821 undefined name 'old_label'
                        path.append([old_label, label])
                                     ^
./aiida/orm/importexport.py:2568:39: F821 undefined name 'filename'
                self._zipfile.getinfo(filename)
                                      ^
./aiida/orm/importexport.py:2574:21: F821 undefined name 'filename'
                    filename))
                    ^
./aiida/orm/querybuilder.py:391:45: F821 undefined name 'ormclass'
                    if ormclassifiers[2] != ormclass:
                                            ^
./aiida/orm/querybuilder.py:801:20: F821 undefined name 'edge_exists'
                if edge_exists:
                   ^
./aiida/orm/querybuilder.py:906:72: F821 undefined name 'k'
                                    "".format(', '.join(allowed_keys), k)
                                                                       ^
./aiida/orm/querybuilder.py:1751:37: F821 undefined name 'val'
                        '{}'.format(val, self._tag_to_alias_map.keys())
                                    ^
./aiida/orm/querybuilder.py:1781:23: F821 undefined name 'replacement_dict'
                inp = replacement_dict.get(inp, inp)
                      ^
./aiida/orm/data/array/trajectory.py:203:22: F821 undefined name 'e'
                type(e).__name__, exc))
                     ^
./aiida/scheduler/plugins/direct.py:152:48: F821 undefined name 'virtualMemoryKb'
            lines.append("ulimit -v {}".format(virtualMemoryKb))
                                               ^
./aiida/cmdline/commands/cmd_calculation.py:374:54: E999 SyntaxError: invalid syntax
            result = control_panel._communicator.await(future[1])
                                                     ^
./aiida/cmdline/commands/cmd_work.py:315:26: E999 SyntaxError: invalid syntax
        communicator.await()
                         ^
./aiida/cmdline/commands/cmd_process.py:163:26: E999 SyntaxError: invalid syntax
        communicator.await()
                         ^
4     E999 SyntaxError: invalid syntax
33    F821 undefined name 'e'
37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants