Created
April 8, 2022 22:20
-
-
Save azundo/ad0fd7b739a7147d290c33ad88ac4ddc to your computer and use it in GitHub Desktop.
Pipenv utils to rewrite lockfiles to work around pipenv bugs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pipenv.project import Project | |
# for working around bug mentioned in https://github.com/pypa/pipenv/issues/4263 | |
def remove_package(package_name): | |
project = Project() | |
lockfile = project.get_or_create_lockfile() | |
if package_name in lockfile.default: | |
del lockfile.default[package_name] # if in normal dependencies | |
if package_name in lockfile.develop: | |
del lockfile.develop[package_name] # if in dev | |
lockfile.write() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment