steve-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neal McBurnett (JIRA)" <>
Subject [jira] [Created] (STEVE-54) circular dependencies in cannot import name election
Date Sat, 13 Apr 2019 17:56:00 GMT
Neal McBurnett created STEVE-54:

             Summary: circular dependencies in cannot import name election
                 Key: STEVE-54
             Project: Steve
          Issue Type: Bug
         Environment: Linux, Ubuntu Bionic

            Reporter: Neal McBurnett

Trying to run Steve in cli mode, I take the current code from the git mirror, commit 55ec041
2019-04-01 Return candidates on short-circuitings.

I change to "dbsys: file" in steve.cfg, and run setup:
$ python ./
Reading steve.cfg 
Traceback (most recent call last): 
 File "./", line 36, in <module>
 from lib import election, voter, constants 
 File "/srv/s/ranked-choice/steve/lib/", line 31, in <module>
 import constants, voter 
 File "/srv/s/ranked-choice/steve/lib/", line 31, in <module>
 from lib import constants, election
ImportError: cannot import name election{code}
This seems related to the circular dependency on imports described here: []

since importing voter is trying to import election which is in the process of being imported.

A similar import loop arises when I try to fix another bug in, by importing election,
since I otherwise get
$ ./ -e /tmp/e -i /tmp/e
Traceback (most recent call last):
File "./", line 63, in <module>
votes = election.getVotes(args.election, args.issue)
File "/srv/s/ranked-choice/steve/lib/", line 74, in getVotes
return backend.votes_get(electionID, issueID)
File "/srv/s/ranked-choice/steve/lib/backends/", line 86, in votes_get
rvotes = election.getVotesRaw(electionID, issueID)
NameError: global name 'election' is not defined


This message was sent by Atlassian JIRA

View raw message