1
1
# -*- coding: utf-8 -*-
2
2
#
3
+ # WinPython Package Manager
3
4
# Copyright © 2012 Pierre Raybaut
5
+ # Copyright © 2014-2025+ The Winpython development team https://github.com/winpython/
4
6
# Licensed under the terms of the MIT License
5
7
# (see winpython/__init__.py for details)
6
8
7
- """
8
- WinPython Package Manager
9
-
10
- Created on Fri Aug 03 14:32:26 2012
11
- """
12
-
13
9
import os
14
10
from pathlib import Path
15
11
import shutil
22
18
# Local imports
23
19
from winpython import utils , piptree
24
20
25
-
26
21
# Workaround for installing PyVISA on Windows from source:
27
22
os .environ ["HOME" ] = os .environ ["USERPROFILE" ]
28
23
29
24
class Package :
30
25
"standardize a Package from filename or pip list"
31
- def __init__ (self , fname , suggested_summary = None ):
26
+ def __init__ (self , fname , suggested_summary = None ):
32
27
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 ""
34
29
self .name = None
35
30
self .version = None
36
31
if fname .endswith ((".zip" , ".tar.gz" , ".whl" )):
@@ -39,14 +34,12 @@ def __init__(self, fname, suggested_summary=None):
39
34
if infos is not None :
40
35
self .name , self .version = infos
41
36
self .name = utils .normalize (self .name )
42
- self .url = None
37
+ self .url = f"https://pypi.org/project/ { self . name } "
43
38
self .files = []
44
39
45
- setattr (self ,'url' ,"https://pypi.org/project/" + self .name )
46
-
47
40
def __str__ (self ):
48
41
return f"{ self .name } { self .version } \r \n { self .description } \r \n Website: { self .url } "
49
-
42
+
50
43
51
44
class Distribution :
52
45
def __init__ (self , target = None , verbose = False ):
0 commit comments