-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
163 lines (151 loc) · 4.92 KB
/
setup.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
from setuptools import setup, find_namespace_packages
import sys
import subprocess
from setuptools.command.install import install
from pathlib import Path
import shutil
# Read requirements from requirements.txt
with open("requirements.txt") as f:
requirements = [
line.strip() for line in f if line.strip() and not line.startswith("#")
]
# Read long description from README.md
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
class PostInstallCommand(install):
def run(self):
install.run(self)
# Get package directory
pkg_dir = Path(__file__).parent
# Get installation directory (where user ran pip install)
install_dir = Path.cwd()
# Files to copy
core_dirs = ["pynions", "workflows", "docs", "tests", "data"]
config_files = [
(".env.example", ".env"),
("pynions.example.json", "pynions.json"),
("README.md", "README.md"),
("requirements.txt", "requirements.txt"),
("pytest.ini", "pytest.ini"),
]
# Copy core directories
for dir_name in core_dirs:
src_dir = pkg_dir / dir_name
dst_dir = install_dir / dir_name
if src_dir.exists() and not dst_dir.exists():
shutil.copytree(src_dir, dst_dir)
# Copy config files
for src_name, dst_name in config_files:
src = pkg_dir / src_name
dst = install_dir / dst_name
if src.exists() and not dst.exists():
shutil.copy2(src, dst)
print("\n✨ Pynions installed successfully!")
print("\n🚀 Quick Start:")
print("1. Add your API keys to .env:")
print(" - OPENAI_API_KEY (required)")
print(" - SERPER_API_KEY (for search)")
print(" - ANTHROPIC_API_KEY (for Claude)")
print(" - JINA_API_KEY (for embeddings)")
print("\n2. Try an example workflow:")
print(" python workflows/example_workflow.py")
print("\n📚 Documentation: docs/")
print("🔧 Configuration: pynions.json")
print("🧪 Run tests: pytest")
setup(
name="pynions",
version="0.2.32",
author="Tomas Laurinavicius",
author_email="[email protected]",
description="Simple marketing automation framework",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/craftled/pynions",
packages=find_namespace_packages(include=["pynions*"]),
package_data={
"pynions": [
"**/*", # Include all files under pynions
"../workflows/**/*",
"../docs/**/*",
"../tests/**/*",
"../data/**/*",
"../.env.example",
"../pynions.example.json",
"../README.md",
"../requirements.txt",
"../pytest.ini",
],
},
data_files=[
(
".",
[
".env.example",
"pynions.example.json",
"README.md",
"requirements.txt",
"pytest.ini",
],
),
(
"pynions",
[
f"pynions/{f}"
for f in [
"__init__.py",
"core/__init__.py",
"plugins/__init__.py",
"tests/__init__.py",
# Add all other Python files
]
],
),
(
"workflows",
[
"workflows/example_workflow.py",
"workflows/content_analysis_workflow.py",
"workflows/research_workflow.py",
"workflows/alternatives_writer.py",
],
),
(
"docs",
[
f"docs/{f}"
for f in [
"changelog.md",
"configuration.md",
"data-organization.md",
"debugging.md",
"index.md",
"installation.md",
"nav.json",
"plugins.md",
"project-structure.md",
"quickstart.md",
"testing.md",
"workers.md",
"workflows.md",
]
],
),
("data", []),
("tests", ["tests/test_config.py"]),
],
install_requires=requirements,
cmdclass={
"install": PostInstallCommand,
},
include_package_data=True,
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Topic :: Office/Business",
],
python_requires=">=3.8",
)