forked from PyFarsi/pyabr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack-wheel.py
executable file
·49 lines (34 loc) · 1.49 KB
/
pack-wheel.py
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
'''
Pyabr OS
Python Cloud Operating System Platform (c) 2021 PyFarsi. Free Software GNU General Public License v3.0
- Informations
* Name: Pyabr
* Founder: Mani Jamali
* Developers: PyFarsi Community
* Package Manager: Paye, PyPI
* License: GNU General Publice License v3.0
- Official Website
* Persian Page: https://pyabr.ir
* English Page: https://en.pyabr.ir
'''
import shutil, os, sys,py_compile
import base64
if not os.path.isdir ("build-packs"): os.mkdir ("build-packs")
if not os.path.isdir ("wheel/src"): os.mkdir("wheel/src")
shutil.unpack_archive('wheel/setup.zip','wheel/setup','zip') # Unpack setup wheel package
## Copy all files and dirs in wheel/setup/src ##
list = ['packs','buildlibs','clean.py','install.py']
for i in list:
if os.path.isdir(i):
shutil.copytree(i,'wheel/src/'+i)
else:
shutil.copyfile(i, 'wheel/src/'+i)
shutil.copyfile('LICENSE','wheel/setup/LICENSE')
shutil.copyfile('README.md','wheel/setup/README.md')
shutil.copyfile('wheel/setup-pack.py','wheel/setup/setup.py')
shutil.copyfile('wheel/setup-installer.py','wheel/setup/pyabr/setup.py')
file = open ("wheel/setup/pyabr/__main__.py","w");file.write('from pyabr import setup');file.close()
## Pack src to setup ##
shutil.make_archive('wheel/setup/pyabr/pyabr','zip','wheel/src')
## Build wheel package and save it to build-packs ##
os.system ("cd wheel/setup && \""+sys.executable+"\" setup.py bdist_wheel")