-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathsetup.py
More file actions
82 lines (75 loc) · 3.24 KB
/
setup.py
File metadata and controls
82 lines (75 loc) · 3.24 KB
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
from setuptools import setup, find_packages
import re
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
# Replace relative links with absolute GitHub URLs
repo_url = "https://github.com/civai-technologies/cursor-agent"
branch = "main" # Assuming main is the default branch
# Process in this order:
# 1. First handle image links separately (which use ![ syntax)
img_pattern = r'!\[([^\]]+)\]\((?!https?://)([^)]+)\)'
img_replacement = lambda m: f'})'
long_description = re.sub(img_pattern, img_replacement, long_description)
# 2. Replace directory links (paths ending with /)
dir_with_slash_pattern = r'\[([^\]]+)\]\((?!https?://|#)([^)]+/)\)'
dir_with_slash_replacement = lambda m: f'[{m.group(1)}]({repo_url}/tree/{branch}/{m.group(2)})'
long_description = re.sub(dir_with_slash_pattern, dir_with_slash_replacement, long_description)
# 3. Replace directory links without trailing slash - looking for directories referenced in the TOC
# This targets paths without extensions that are likely directories
dir_pattern = r'\[([^\]]+)\]\((?!https?://|#)([^.)]+)\)'
dir_replacement = lambda m: f'[{m.group(1)}]({repo_url}/tree/{branch}/{m.group(2)})'
long_description = re.sub(dir_pattern, dir_replacement, long_description)
# 4. Finally replace remaining file links
file_pattern = r'\[([^\]]+)\]\((?!https?://|#)([^)]+\.[a-zA-Z0-9]+[^)]*)\)'
file_replacement = lambda m: f'[{m.group(1)}]({repo_url}/blob/{branch}/{m.group(2)})'
long_description = re.sub(file_pattern, file_replacement, long_description)
setup(
name="cursor-agent-tools",
version="0.1.39",
author="Nifemi Alpine",
author_email="hello@civai.co",
description="Cursor Agent Tools - A Python-based AI agent that replicates Cursor's coding assistant capabilities",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/civai-technologies/cursor-agent",
packages=find_packages(include=["cursor_agent_tools", "cursor_agent_tools.*"]),
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
python_requires=">=3.8",
install_requires=[
"anthropic>=0.49.0",
"openai>=1.6.1",
"colorama>=0.4.6",
"python-dotenv>=1.0.0",
"typing-extensions>=4.8.0",
"requests>=2.31.0",
"urllib3>=2.0.7",
"httpx>=0.25.0",
"ollama>=0.4.0",
"beautifulsoup4>=4.12.0",
],
extras_require={
"dev": [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"black>=23.0.0",
"isort>=5.12.0",
"flake8>=6.0.0",
"mypy>=1.0.0",
"bump2version>=1.0.0",
]
},
include_package_data=True,
zip_safe=False,
metadata_version="2.1",
)