-
Notifications
You must be signed in to change notification settings - Fork 349
Expand file tree
/
Copy pathsetup.py
More file actions
101 lines (90 loc) · 2.87 KB
/
setup.py
File metadata and controls
101 lines (90 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see winpython/__init__.py for details)
"""
WinPython
=========
The WinPython distribution tools (wppm, ...)
"""
# for wheels creation
import setuptools
from distutils.core import setup
import os
from pathlib import Path
def get_package_data(name, extlist):
"""Return data files for package *name* with extensions in *extlist*"""
flist = []
# Workaround to replace os.path.relpath (not available until Python 2.6):
offset = len(name) + len(os.pathsep)
for dirpath, _dirnames, filenames in os.walk(name):
for fname in filenames:
if (
not fname.startswith('.')
and Path(fname).suffix in extlist
):
flist.append(
str(Path(dirpath) / fname)[offset:]
)
return flist
def get_subpackages(name):
"""Return subpackages of package *name*"""
splist = []
for dirpath, _dirnames, _filenames in os.walk(name):
if (Path(dirpath) / '__init__.py').is_file():
splist.append(".".join(dirpath.split(os.sep)))
return splist
NAME = LIBNAME = 'winpython'
from winpython import __version__, __project_url__
PROJECT_NAME = 'WinPython'
setup(
name=NAME,
version=__version__,
description=f'{PROJECT_NAME} distribution tools, including WPPM',
long_description=f"""{PROJECT_NAME} is a portable distribution of the Python programming language
for Windows. It is a full-featured Python-based scientific environment, :
including a package manager, WPPM.""",
download_url=f'{__project_url__}/files/{NAME}-{__version__}.zip',
author="Pierre Raybaut",
author_email='pierre.raybaut@gmail.com',
url=__project_url__,
license='MIT',
keywords='PyQt5 PyQt4 PySide',
platforms=['any'],
packages=get_subpackages(LIBNAME),
package_data={
LIBNAME: get_package_data(
LIBNAME,
(
'.mo',
'.svg',
'.png',
'.css',
'.html',
'.js',
'.ini',
),
)
},
# use setuptools functionalities
entry_points={
'console_scripts': [
'wpcp = winpython.controlpanel:main',
'wppm = winpython.wppm:main',
]
},
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: OS Independent',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'Topic :: Scientific/Engineering',
'Topic :: Software Development :: Widget Sets',
],
)