PyPInclude 0.0.1__py3-none-any.whl → 0.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
PyPInclude.py CHANGED
@@ -1,4 +1,6 @@
1
- assert 0, "ver 0.0.1 isn't supported"
1
+ #code stinks.
2
+
3
+ from martialaw.martialaw import martialaw as _clsr
2
4
 
3
5
  from setuptools import setup as __setup__
4
6
  from setuptools.command.install import install as __install__
@@ -12,6 +14,11 @@ from os.path import sep as __path_sep__
12
14
  from os.path import basename as __base_name__
13
15
  from subprocess import run as __shell__
14
16
 
17
+ """
18
+ DEPRECATED when 0.0.2
19
+
20
+ it's indev ver. see repo's markdown. the range of age of indev ver is writed and also it will update over commit over commits
21
+
15
22
  @lambda f : f()
16
23
  def lib():
17
24
  data = {}
@@ -34,11 +41,12 @@ def lib():
34
41
  def deco(value):
35
42
  return addvar(name, value)
36
43
  return deco
37
- def __neg__(self):
38
- def deco(func):
39
- return addvar(func.__name__, func)
40
- return deco
41
- return PyPInstallLibExporter()
44
+
45
+ def __neg__(self):
46
+ def deco(func):
47
+ return addvar(func.__name__, func)
48
+ return deco
49
+ return PyPInstallLibExporter()
42
50
 
43
51
  def __getitem__(self, libname):
44
52
  class PyPInstallModuleType:
@@ -50,34 +58,76 @@ def lib():
50
58
  return PyPInstallModuleType()
51
59
  return PyPInstallLibType()
52
60
 
61
+ cannot make private in python. function.__code__.co_varnames and function.__closure__ is can hake them.
62
+ """
63
+
53
64
  def __return_name_if_is_exist_in__(f, target, where):
54
65
  ret = __join_path__(where, target)
55
- return (ret if f(ret) else None) if target in where else None
66
+ return (ret if f(ret) else None) if target in __ls__(where) else None
67
+
68
+ def __dictsubdict_setattr__(dict, subdictname, attrvalue, *attrname): # func 4 readiblity... pythonic function is actually god-damb dictionarry manager and god-damb virtual machine overhead. even calling overhead is not c functional. but I used it. for readibility
69
+ p, q = subdictname in dict, bool(attrname) # why I use variable 2 use god-damb local memory? : for readibility
70
+ if p and q: dict[subdictname][attrname[0]] = attrvalue
71
+ elif q: dict[subdictname] = { attrname[0] : attrvalue }
72
+ elif p: dict[subdictname].append(attrvalue)
73
+ else: dict[subdictname] = [attrvalue]
56
74
 
57
- def __core__(package_paths, **kargv):
75
+ def setup(*, package_paths, **kargv):
58
76
  ret = {}
59
77
  for package_path in package_paths:
60
78
  PyPInclude = __return_name_if_is_exist_in__(__is_dir__, "__PyPInclude__", package_path)
61
- if PyPInclude:
62
- if "package_data" in ret: ret["package_data"][package_path] = ["__PyPInclude__/*"]
63
- else: ret["package_data"] = { package_path : ["__PyPInclude__/*"] }
79
+
80
+ # /* Step 1. Processing the PyPInclude */
81
+ if PyPInclude: # if PyPInclude isn't Falsy Value such as None (= if PyPInclude is exist in package_path as directory)
82
+
83
+ # /* Step 1.1. check which is it possible to acess ret["package_data"] then add package_path key as value which "__PyPInclude__/*" */
84
+ __dictsubdict_setattr__(ret, "packages_data", ["__PyPInclude__/*"], package_path)
85
+
86
+ # /* Step 1.2. add package name which __PyPIncluder__/ __main__.py is exist */
64
87
  if __return_name_if_is_exist_in__(__is_file__, "__main__.py", PyPInclude):
65
- if "cmdclass" in ret: ret["cmclass"].append(__base_name__(package_path))
66
- else: ret["cmclass"] = [__base_name__(package_path)]
88
+ # /* see. it's same repartory as step 1 */
89
+ __dictsubdict_setattr__(ret, "cmclass", __base_name__(package_path))
90
+
91
+ # /* Step 2. update cmclass as can use in setup function by defining cmclass which install class and develop class and use them */
67
92
  if "cmclass" in ret:
68
93
  cmclass = ret["cmclass"]
94
+
95
+ is_in_cmclass = cmclass.__contains__
96
+ get_confscript_path_getter = _clsr(lambda installed_dir_of_pkg, pkgname : __join_path__(installed_dir_of_pkg, pkgname, "__PyPInclude__", "__main__.py"))
97
+
98
+ # /* Step 2.1. set pip install's Configuration Script */
69
99
  class install(__install__):
100
+ # PEP 253, all class is based on MRO. including built-in types. we don't need to write __init__ function.
70
101
  def run(self):
71
102
  __install__.run(self)
72
- installed_dir = self.install_lib
73
- for init_script in map(lambda x : __join_path__(installed_dir, x, "__PyPInclude__", "main.py"), filter(cmclass.__contains__, self.distribution.packages)): __shell__(["python", "-m", init_script])
103
+ _ = map(
104
+ get_confscript_path_getter(
105
+ self.install_lib #install_dir_of_pkg(directory which package is install)
106
+ ), # path of install script
107
+ filter(
108
+ is_in_cmclass,
109
+ self.distribution.packages
110
+ ) # packages such that conf script is exist
111
+ ) # conf script paths
112
+ for init_script in _: __shell__(["python", init_script]) # run each conf scripts
113
+
114
+ # /* Step 2.2. set pip install -e's Configuration Script */
74
115
  class develop(__develop__):
75
116
  def run(self):
76
117
  __develop__.run(self)
77
- installed_dir = self.egg_path
78
- for init_script in map(lambda x : __join_path__(installed_dir, x, "__PyPInclude__", "main.py"), filter(cmclass.__contains__, self.distribution.packages)): __shell__(["python", "-m", init_script])
118
+ _ = map(
119
+ get_confscript_path_getter(
120
+ self.egg_path
121
+ ),
122
+ filter(
123
+ is_in_cmclass,
124
+ self.distribution.packages
125
+ )
126
+ )
127
+ for init_script in _: __shell__(["python", init_script])
128
+
129
+ # /* Step 2. 3. update! */
79
130
  ret["cmclass"] = {"install" : install, "develop" : develop}
80
- return ret
81
131
 
82
- def setup(*, package_paths, **kargv):
83
- return __setup__(**kargv, **__core__(package_paths, **kargv))
132
+ # /* now cmclass and included directory is setted */
133
+ return __setup__(**kargv, **ret)
@@ -1,13 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPInclude
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: PyPInclude (PyPI includer)
5
5
  Home-page: https://github.com/FarAway6834/PyPInclude
6
6
  Author: du7ec
7
7
  Author-email: dutec6834@gmail.com
8
- Keywords: PyPI,include,PyPInclude,PyPIncluder,includer,PyPIinclude,PyPIInclude,PyPIincluder,PyPIIncluder,setuptools,include_files,files,pypi,pypi_includer,pypi_include
8
+ Keywords: python,PyPI,include,PyPInclude,PyPIncluder,includer,PyPIinclude,PyPIInclude,PyPIincluder,PyPIIncluder,setuptools,include_files,files,pypi,pypi_includer,pypi_include
9
9
  License-File: LICENSE
10
10
  Requires-Dist: setuptools
11
+ Requires-Dist: privathon
11
12
  Dynamic: author
12
13
  Dynamic: author-email
13
14
  Dynamic: home-page
@@ -0,0 +1,6 @@
1
+ PyPInclude.py,sha256=yKRLdZh5_XT1uOEmgdWsGpn_bWo0_bhgPR-jkkc5fmM,6034
2
+ pypinclude-0.0.3.dist-info/licenses/LICENSE,sha256=V3Kqklsa89FmOApeCHTd2WVQx9SBbC4b41O0Ig_WGfo,1068
3
+ pypinclude-0.0.3.dist-info/METADATA,sha256=mmQghPGtQc47SqokaCD121m1CUC-4oS5qvAip7qZdEg,576
4
+ pypinclude-0.0.3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
5
+ pypinclude-0.0.3.dist-info/top_level.txt,sha256=i9TGT2uJ2C_Qqu_fLZduO4mIzR9Usznzl0gGDmCIOS0,11
6
+ pypinclude-0.0.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +0,0 @@
1
- PyPInclude.py,sha256=X_qL0D2HDmI0df7u47ZYAEFh2rFqrVLQjUD3dTtTKvw,3801
2
- pypinclude-0.0.1.dist-info/licenses/LICENSE,sha256=V3Kqklsa89FmOApeCHTd2WVQx9SBbC4b41O0Ig_WGfo,1068
3
- pypinclude-0.0.1.dist-info/METADATA,sha256=vxZoaSalHtN37lgGUDmy3xm0Km2DRYh0qvbuKuO825c,544
4
- pypinclude-0.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
- pypinclude-0.0.1.dist-info/top_level.txt,sha256=i9TGT2uJ2C_Qqu_fLZduO4mIzR9Usznzl0gGDmCIOS0,11
6
- pypinclude-0.0.1.dist-info/RECORD,,