PyPInclude 0.0.1__tar.gz → 0.0.3__tar.gz

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.
@@ -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
@@ -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
@@ -1 +1,2 @@
1
1
  setuptools
2
+ privathon
@@ -0,0 +1,133 @@
1
+ #code stinks.
2
+
3
+ from martialaw.martialaw import martialaw as _clsr
4
+
5
+ from setuptools import setup as __setup__
6
+ from setuptools.command.install import install as __install__
7
+ from setuptools.command.develop import develop as __develop__
8
+ from setuptools import find_packages
9
+ from os import listdir as __ls__
10
+ from os.path import join as __join_path__
11
+ from os.path import isdir as __is_dir__
12
+ from os.path import isfile as __is_file__
13
+ from os.path import sep as __path_sep__
14
+ from os.path import basename as __base_name__
15
+ from subprocess import run as __shell__
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
+
22
+ @lambda f : f()
23
+ def lib():
24
+ data = {}
25
+ class PyPInstallLibType:
26
+ '''
27
+ this class's data is not in this object. this class's data is in function which return this class's object.
28
+ '''
29
+ def __call__(self, libname, pw):
30
+ if libname in data: assert data[libname][0] == hash(pw), "permission denied"
31
+ else: data[libname] = (hash(pw), {})
32
+ def addvar(var, value):
33
+ data[libname][1][var] = value
34
+ return value
35
+
36
+ class PyPInstallLibExporter:
37
+ '''
38
+ this class's data is not in this object. this class's data is in function which return this class's object.
39
+ '''
40
+ def __getitem__(self, name):
41
+ def deco(value):
42
+ return addvar(name, value)
43
+ return deco
44
+
45
+ def __neg__(self):
46
+ def deco(func):
47
+ return addvar(func.__name__, func)
48
+ return deco
49
+ return PyPInstallLibExporter()
50
+
51
+ def __getitem__(self, libname):
52
+ class PyPInstallModuleType:
53
+ '''
54
+ this class's data is not in this object. this class's data is in function which return this class's object.
55
+ '''
56
+ def __getitems__(self, member):
57
+ return data[libname][1][member]
58
+ return PyPInstallModuleType()
59
+ return PyPInstallLibType()
60
+
61
+ cannot make private in python. function.__code__.co_varnames and function.__closure__ is can hake them.
62
+ """
63
+
64
+ def __return_name_if_is_exist_in__(f, target, where):
65
+ ret = __join_path__(where, target)
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]
74
+
75
+ def setup(*, package_paths, **kargv):
76
+ ret = {}
77
+ for package_path in package_paths:
78
+ PyPInclude = __return_name_if_is_exist_in__(__is_dir__, "__PyPInclude__", package_path)
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 */
87
+ if __return_name_if_is_exist_in__(__is_file__, "__main__.py", PyPInclude):
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 */
92
+ if "cmclass" in ret:
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 */
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.
101
+ def run(self):
102
+ __install__.run(self)
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 */
115
+ class develop(__develop__):
116
+ def run(self):
117
+ __develop__.run(self)
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! */
130
+ ret["cmclass"] = {"install" : install, "develop" : develop}
131
+
132
+ # /* now cmclass and included directory is setted */
133
+ return __setup__(**kargv, **ret)
@@ -0,0 +1,7 @@
1
+ # PyPInclude
2
+ PyPI includer
3
+
4
+ ## dev note
5
+
6
+ 1. it will patched to use [it](https://github.com/FarAway6834/privathon)
7
+ 2. 0.0.2 ~ now is indev ver
@@ -0,0 +1,12 @@
1
+ from setuptools import setup
2
+
3
+ setup(
4
+ name="PyPInclude",
5
+ version="0.0.3",
6
+ description = "PyPInclude (PyPI includer)",
7
+ py_modules=["PyPInclude"],
8
+ install_requires=["setuptools", "privathon"],
9
+ author='du7ec',
10
+ author_email='dutec6834@gmail.com',
11
+ keywords=["python", 'PyPI', 'include', "PyPInclude", "PyPIncluder", "includer", "PyPIinclude", "PyPIInclude", "PyPIincluder", "PyPIIncluder", "setuptools", "include_files", "files", "pypi", "pypi_includer", "pypi_include"], url='https://github.com/FarAway6834/PyPInclude'
12
+ )
@@ -1,83 +0,0 @@
1
- assert 0, "ver 0.0.1 isn't supported"
2
-
3
- from setuptools import setup as __setup__
4
- from setuptools.command.install import install as __install__
5
- from setuptools.command.develop import develop as __develop__
6
- from setuptools import find_packages
7
- from os import listdir as __ls__
8
- from os.path import join as __join_path__
9
- from os.path import isdir as __is_dir__
10
- from os.path import isfile as __is_file__
11
- from os.path import sep as __path_sep__
12
- from os.path import basename as __base_name__
13
- from subprocess import run as __shell__
14
-
15
- @lambda f : f()
16
- def lib():
17
- data = {}
18
- class PyPInstallLibType:
19
- '''
20
- this class's data is not in this object. this class's data is in function which return this class's object.
21
- '''
22
- def __call__(self, libname, pw):
23
- if libname in data: assert data[libname][0] == hash(pw), "permission denied"
24
- else: data[libname] = (hash(pw), {})
25
- def addvar(var, value):
26
- data[libname][1][var] = value
27
- return value
28
-
29
- class PyPInstallLibExporter:
30
- '''
31
- this class's data is not in this object. this class's data is in function which return this class's object.
32
- '''
33
- def __getitem__(self, name):
34
- def deco(value):
35
- return addvar(name, value)
36
- return deco
37
- def __neg__(self):
38
- def deco(func):
39
- return addvar(func.__name__, func)
40
- return deco
41
- return PyPInstallLibExporter()
42
-
43
- def __getitem__(self, libname):
44
- class PyPInstallModuleType:
45
- '''
46
- this class's data is not in this object. this class's data is in function which return this class's object.
47
- '''
48
- def __getitems__(self, member):
49
- return data[libname][1][member]
50
- return PyPInstallModuleType()
51
- return PyPInstallLibType()
52
-
53
- def __return_name_if_is_exist_in__(f, target, where):
54
- ret = __join_path__(where, target)
55
- return (ret if f(ret) else None) if target in where else None
56
-
57
- def __core__(package_paths, **kargv):
58
- ret = {}
59
- for package_path in package_paths:
60
- 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__/*"] }
64
- 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)]
67
- if "cmclass" in ret:
68
- cmclass = ret["cmclass"]
69
- class install(__install__):
70
- def run(self):
71
- __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])
74
- class develop(__develop__):
75
- def run(self):
76
- __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])
79
- ret["cmclass"] = {"install" : install, "develop" : develop}
80
- return ret
81
-
82
- def setup(*, package_paths, **kargv):
83
- return __setup__(**kargv, **__core__(package_paths, **kargv))
@@ -1,2 +0,0 @@
1
- # PyPInclude
2
- PyPI includer
pypinclude-0.0.1/setup.py DELETED
@@ -1,12 +0,0 @@
1
- from setuptools import setup
2
-
3
- setup(
4
- name="PyPInclude",
5
- version="0.0.1",
6
- description = "PyPInclude (PyPI includer)",
7
- py_modules=["PyPInclude"],
8
- install_requires=["setuptools"],
9
- author='du7ec',
10
- author_email='dutec6834@gmail.com',
11
- keywords=['PyPI', 'include', "PyPInclude", "PyPIncluder", "includer", "PyPIinclude", "PyPIInclude", "PyPIincluder", "PyPIIncluder", "setuptools", "include_files", "files", "pypi", "pypi_includer", "pypi_include"], url='https://github.com/FarAway6834/PyPInclude'
12
- )
File without changes
File without changes