10000 small simplification · winpython/winpython@2a6fbd9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a6fbd9

Browse files
committed
small simplification
1 parent 677932c commit 2a6fbd9

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

winpython/wppm.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
# -*- coding: utf-8 -*-
22
#
3+
# WinPython Package Manager
34
# Copyright © 2012 Pierre Raybaut
5+
# Copyright © 2014-2025+ The Winpython development team https://github.com/winpython/
46
# Licensed under the terms of the MIT License
57
# (see winpython/__init__.py for details)
68

7-
"""
8-
WinPython Package Manager
9-
10-
Created on Fri Aug 03 14:32:26 2012
11-
"""
12-
139
import os
1410
from pathlib import Path
1511
import shutil
@@ -22,15 +18,14 @@
2218
# Local imports
2319
from winpython import utils, piptree
2420

25-
2621
# Workaround for installing PyVISA on Windows from source:
2722
os.environ["HOME"] = os.environ["USERPROFILE"]
2823

2924
class Package:
3025
"standardize a Package from filename or pip list"
31-
def __init__(self, fname, suggested_summary=None):
26+
def __init__(self, fname, suggested_summary=None):
3227
self.fname = fname
33-
self.description = piptree.sum_up(suggested_summary) if suggested_summary else ""
28+
self.description = piptree.sum_up(suggested_summary) if suggested_summary else ""
3429
self.name = None
3530
self.version = None
3631
if fname.endswith((".zip", ".tar.gz", ".whl")):
@@ -39,14 +34,12 @@ def __init__(self, fname, suggested_summary=None):
3934
if infos is not None:
4035
self.name, self.version = infos
4136
self.name = utils.normalize(self.name)
42-
self.url = None
37+
self.url = f"https://pypi.org/project/{self.name}"
4338
self.files = []
4439

45-
setattr(self,'url',"https://pypi.org/project/" + self.name)
46-
4740
def __str__(self):
4841
return f"{self.name} {self.version}\r\n{self.description}\r\nWebsite: {self.url}"
49-
42+
5043

5144
class Distribution:
5245
def __init__(self, target=None, verbose=False):

0 commit comments

Comments
 (0)
0