Skip to content

Commit 423c3af

Browse files
committed
Add .egg support
1 parent 61e9b24 commit 423c3af

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pypi_browser/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
PACKAGE_TYPE_NOT_SUPPORTED_ERROR = (
32-
'Sorry, this package type is not yet supported (only .zip and .whl supported currently).'
32+
'Sorry, this package type is not yet supported (only .zip, .whl, and .egg supported currently).'
3333
)
3434

3535
ONE_KB = 2**10

pypi_browser/packaging.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class UnsupportedPackageType(Exception):
2121
class PackageType(enum.Enum):
2222
SDIST = enum.auto()
2323
WHEEL = enum.auto()
24+
EGG = enum.auto()
2425

2526

2627
class PackageFormat(enum.Enum):
@@ -86,6 +87,9 @@ def from_path(cls, path: str) -> 'Package':
8687
elif name.endswith('.zip'):
8788
package_type = PackageType.SDIST
8889
package_format = PackageFormat.ZIPFILE
90+
elif name.endswith('.egg'):
91+
package_type = PackageType.EGG
92+
package_format = PackageFormat.ZIPFILE
8993
else:
9094
# TODO: Add support for tarballs
9195
raise UnsupportedPackageType(name)

0 commit comments

Comments
 (0)