Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #228 from MrMrRobat/patch-1
Browse files Browse the repository at this point in the history
Fix RuntimeError: dictionary changed size
  • Loading branch information
orsinium committed Jul 16, 2019
2 parents 59a0a24 + afa1fba commit 6078d31
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ before_install:
# install DepHell
# - curl https://raw.githubusercontent.com/dephell/dephell/master/install.py | /opt/python/3.6/bin/python
# https://github.com/travis-ci/travis-ci/issues/8589
- /opt/python/3.7/bin/python install.py --branch=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- >
/opt/python/3.7/bin/python install.py
--branch=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
--slug=${TRAVIS_PULL_REQUEST_SLUG:-dephell/dephell}
- dephell inspect self
install:
- dephell venv create --env=$ENV --python="/opt/python/$TRAVIS_PYTHON_VERSION/bin/python" --level=DEBUG --traceback
Expand All @@ -39,7 +42,10 @@ matrix:
language: generic
env: ENV=pytest
before_install:
- /usr/local/bin/python3 install.py --branch=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- >
/usr/local/bin/python3 install.py
--branch=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
--slug=${TRAVIS_PULL_REQUEST_SLUG:-dephell/dephell}
- dephell inspect self
install:
- dephell venv create --env=$ENV --python=/usr/local/bin/python3 --level=DEBUG --traceback
Expand Down
7 changes: 3 additions & 4 deletions dephell/converters/pipfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ def dumps(self, reqs, project: RootDependency, content=None) -> str:
continue

# clean packages from old packages
names = {req.name for req in reqs if is_dev is req.is_dev}
for name in doc[section]:
if name not in names:
del doc[section][name]
req_names = {req.name for req in reqs if is_dev is req.is_dev}
for old_req in {name for name in doc[section] if name not in req_names}:
del doc[section][old_req]

# write new packages
for section, is_dev in [('packages', False), ('dev-packages', True)]:
Expand Down
6 changes: 4 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
parser = ArgumentParser()
parser.add_argument('--branch', help='install dephell from git from given branch')
parser.add_argument('--version', help='install specified version')
parser.add_argument('--slug', default='dephell/dephell',
help='repository slug to use when installing from Github')
args = parser.parse_args()


Expand Down Expand Up @@ -64,8 +66,8 @@ def get_data_dir() -> Path:

print('install dephell')
if args.branch:
name = 'git+https://github.com/dephell/dephell.git@{branch}#egg=dephell[full]'
name = name.format(branch=args.version or args.branch)
name = 'git+https://github.com/{slug}.git@{branch}#egg=dephell[full]'
name = name.format(slug=args.slug, branch=args.version or args.branch)
elif args.version:
name = 'dephell[full]=={version}'.format(version=args.version)
else:
Expand Down

0 comments on commit 6078d31

Please sign in to comment.