Skip to content

Commit 4477e4a

Browse files
authored
Merge pull request #12 from HKUDS/pypi
Add pypi-publish.yml
2 parents 98338c2 + 38ca6ef commit 4477e4a

File tree

7 files changed

+265
-7
lines changed

7 files changed

+265
-7
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Upload DeepCode Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
release-build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.x"
20+
21+
- name: Build release distributions
22+
run: |
23+
python -m pip install build
24+
python -m build
25+
26+
- name: Upload distributions
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: release-dists
30+
path: dist/
31+
32+
pypi-publish:
33+
runs-on: ubuntu-latest
34+
needs:
35+
- release-build
36+
permissions:
37+
id-token: write
38+
39+
environment:
40+
name: pypi
41+
42+
steps:
43+
- name: Retrieve release distributions
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: release-dists
47+
path: dist/
48+
49+
- name: Publish release distributions to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1
51+
with:
52+
packages-dir: dist/

MANIFEST.in

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
include README.md
2+
include LICENSE
3+
include requirements.txt
4+
include *.png
5+
include *.yaml
6+
recursive-include config *.yaml
7+
recursive-include prompts *
8+
recursive-include schema *
9+
recursive-include ui *.py
10+
recursive-include cli *.py
11+
recursive-include utils *.py
12+
recursive-include tools *.py
13+
recursive-include workflows *.py
14+
global-exclude *.pyc
15+
global-exclude .git*
16+
global-exclude .history*
17+
global-exclude .ruff_cache*
18+
global-exclude __pycache__*

README.md

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<table style="border: none; margin: 0 auto; padding: 0; border-collapse: collapse;">
44
<tr>
55
<td align="center" style="vertical-align: middle; padding: 10px; border: none; width: 250px;">
6-
<img src="logo.png" alt="DeepCode Logo" width="200" style="margin: 0; padding: 0; display: block;"/>
6+
<img src="assets/logo.png" alt="DeepCode Logo" width="200" style="margin: 0; padding: 0; display: block;"/>
77
</td>
88
<td align="left" style="vertical-align: middle; padding: 10px 0 10px 30px; border: none;">
99
<pre style="font-family: 'Courier New', monospace; font-size: 16px; color: #0EA5E9; margin: 0; padding: 0; text-shadow: 0 0 10px #0EA5E9, 0 0 20px rgba(14,165,233,0.5); line-height: 1.2; transform: skew(-1deg, 0deg); display: block;"> ██████╗ ███████╗███████╗██████╗ ██████╗ ██████╗ ██████╗ ███████╗
@@ -16,19 +16,37 @@
1616
</tr>
1717
</table>
1818

19-
<img src="https://readme-typing-svg.herokuapp.com?font=Russo+One&size=28&duration=2000&pause=800&color=06B6D4&background=00000000&center=true&vCenter=true&width=800&height=50&lines=%E2%9A%A1+OPEN+AGENTIC+CODING+%E2%9A%A1" alt="DeepCode Tech Subtitle" style="margin-top: 5px; filter: drop-shadow(0 0 12px #06B6D4) drop-shadow(0 0 24px rgba(6,182,212,0.4));"/>
19+
<!-- <img src="https://readme-typing-svg.herokuapp.com?font=Russo+One&size=28&duration=2000&pause=800&color=06B6D4&background=00000000&center=true&vCenter=true&width=800&height=50&lines=%E2%9A%A1+OPEN+AGENTIC+CODING+%E2%9A%A1" alt="DeepCode Tech Subtitle" style="margin-top: 5px; filter: drop-shadow(0 0 12px #06B6D4) drop-shadow(0 0 24px rgba(6,182,212,0.4));"/> -->
2020

2121
# <img src="https://github.com/Zongwei9888/Experiment_Images/raw/43c585dca3d21b8e4b6390d835cdd34dc4b4b23d/DeepCode_images/title_logo.svg" alt="DeepCode Logo" width="32" height="32" style="vertical-align: middle; margin-right: 8px;"/> DeepCode: Open Agentic Coding
2222

2323
### *Advancing Code Generation with Multi-Agent Systems*
2424

25-
<p align="center">
25+
<!-- <p align="center">
2626
<img src="https://img.shields.io/badge/Version-1.0.0-00d4ff?style=for-the-badge&logo=rocket&logoColor=white" alt="Version">
2727
2828
<img src="https://img.shields.io/badge/License-MIT-4ecdc4?style=for-the-badge&logo=opensourceinitiative&logoColor=white" alt="License">
2929
<img src="https://img.shields.io/badge/AI-Multi--Agent-9b59b6?style=for-the-badge&logo=brain&logoColor=white" alt="AI">
3030
<img src="https://img.shields.io/badge/HKU-Data_Intelligence_Lab-f39c12?style=for-the-badge&logo=university&logoColor=white" alt="HKU">
31+
</p> -->
32+
<p>
33+
<a href="https://github.com/HKUDS/DeepCode/stargazers"><img src='https://img.shields.io/github/stars/HKUDS/DeepCode?color=00d9ff&style=for-the-badge&logo=star&logoColor=white&labelColor=1a1a2e' /></a>
34+
<img src="https://img.shields.io/badge/🐍Python-3.13-4ecdc4?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e">
35+
<a href="https://pypi.org/project/deepcode/"><img src="https://img.shields.io/pypi/v/deepcode.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
36+
</p>
37+
<p>
38+
<a href="https://discord.gg/yF2MmDJyGJ"><img src="https://img.shields.io/badge/💬Discord-Community-7289da?style=for-the-badge&logo=discord&logoColor=white&labelColor=1a1a2e"></a>
39+
<a href="https://github.com/HKUDS/DeepCode/issues/11"><img src="https://img.shields.io/badge/💬WeChat-Group-07c160?style=for-the-badge&logo=wechat&logoColor=white&labelColor=1a1a2e"></a>
3140
</p>
41+
<div align="center">
42+
<div style="width: 100%; height: 2px; margin: 20px 0; background: linear-gradient(90deg, transparent, #00d9ff, transparent);"></div>
43+
</div>
44+
45+
<div align="center">
46+
<a href="#-quick-start" style="text-decoration: none;">
47+
<img src="https://img.shields.io/badge/Quick%20Start-Get%20Started%20Now-00d9ff?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e">
48+
</a>
49+
</div>
3250

3351
### 🖥️ **Interface Showcase**
3452

@@ -389,7 +407,31 @@ Implementation Generation • Testing • Documentation
389407

390408
### 📦 **Step 1: Installation**
391409

392-
#### 🔥 **Using UV (Recommended)**
410+
#### **Direct Installation (Recommended)**
411+
412+
```bash
413+
# 🚀 Install DeepCode package directly
414+
pip install deepcode
415+
416+
# 🔑 Download configuration files
417+
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
418+
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.secrets.yaml
419+
420+
# 🔑 Configure API keys (required)
421+
# Edit mcp_agent.secrets.yaml with your API keys and base_url:
422+
# - openai: api_key, base_url (for OpenAI/custom endpoints)
423+
# - anthropic: api_key (for Claude models)
424+
425+
# 🔑 Configure BRAVE_API_KEY for web search (optional)
426+
# Edit mcp_agent.config.yaml and update BRAVE_API_KEY under brave.env section
427+
```
428+
429+
#### 🔧 **Development Installation (From Source)**
430+
431+
<details>
432+
<summary><strong>📂 Click to expand development installation options</strong></summary>
433+
434+
##### 🔥 **Using UV (Recommended for Development)**
393435

394436
```bash
395437
# 🔽 Clone the repository
@@ -413,7 +455,7 @@ uv pip install -r requirements.txt
413455
# Edit mcp_agent.config.yaml and update BRAVE_API_KEY under brave.env section
414456
```
415457

416-
#### 🐍 **Using Traditional pip**
458+
##### 🐍 **Using Traditional pip**
417459

418460
```bash
419461
# 🔽 Clone the repository
@@ -432,12 +474,24 @@ pip install -r requirements.txt
432474
# Edit mcp_agent.config.yaml and update BRAVE_API_KEY under brave.env section
433475
```
434476

477+
</details>
478+
435479
### **Step 2: Launch Application**
436480

481+
#### 🚀 **Using Installed Package (Recommended)**
482+
483+
```bash
484+
# 🌐 Launch web interface directly
485+
deepcode
486+
487+
# The application will automatically start at http://localhost:8501
488+
```
489+
490+
#### 🛠️ **Using Source Code**
437491

438492
Choose your preferred interface:
439493

440-
#### 🌐 **Web Interface** (Recommended)
494+
##### 🌐 **Web Interface** (Recommended)
441495
```bash
442496
# Using UV
443497
uv run streamlit run ui/streamlit_app.py
@@ -448,7 +502,7 @@ streamlit run ui/streamlit_app.py
448502
<img src="https://img.shields.io/badge/Access-localhost:8501-00d4ff?style=flat-square&logo=streamlit&logoColor=white" alt="Web Access" />
449503
</div>
450504

451-
#### 🖥️ **CLI Interface** (Advanced Users)
505+
##### 🖥️ **CLI Interface** (Advanced Users)
452506
```bash
453507
# Using UV
454508
uv run python cli/main_cli.py

__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
DeepCode - AI Research Engine
3+
4+
🧬 Next-Generation AI Research Automation Platform
5+
⚡ Transform research papers into working code automatically
6+
"""
7+
8+
__version__ = "1.0.1"
9+
__author__ = "DeepCode Team"
10+
__url__ = "https://github.com/HKUDS/DeepCode"
11+
__description__ = "AI Research Engine - Transform research papers into working code automatically"
12+
13+
# Import main components for easy access
14+
from .utils import FileProcessor, DialogueLogger
15+
16+
__all__ = [
17+
"FileProcessor",
18+
"DialogueLogger",
19+
"__version__",
20+
"__author__",
21+
"__url__",
22+
"__description__"
23+
]
File renamed without changes.
File renamed without changes.

setup.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import setuptools
2+
from pathlib import Path
3+
4+
5+
# Reading the long description from README.md
6+
def read_long_description():
7+
try:
8+
return Path("README.md").read_text(encoding="utf-8")
9+
except FileNotFoundError:
10+
return "DeepCode: Open Agentic Coding (Paper2Code & Text2Web & Text2Backend)"
11+
12+
13+
# Retrieving metadata from __init__.py
14+
def retrieve_metadata():
15+
vars2find = ["__author__", "__version__", "__url__", "__description__"]
16+
vars2readme = {}
17+
try:
18+
with open("./__init__.py", encoding="utf-8") as f:
19+
for line in f.readlines():
20+
for v in vars2find:
21+
if line.startswith(v):
22+
line = (
23+
line.replace(" ", "")
24+
.replace('"', "")
25+
.replace("'", "")
26+
.strip()
27+
)
28+
vars2readme[v] = line.split("=")[1]
29+
except FileNotFoundError:
30+
raise FileNotFoundError("Metadata file './__init__.py' not found.")
31+
32+
# Checking if all required variables are found
33+
missing_vars = [v for v in vars2find if v not in vars2readme]
34+
if missing_vars:
35+
raise ValueError(
36+
f"Missing required metadata variables in __init__.py: {missing_vars}"
37+
)
38+
39+
return vars2readme
40+
41+
42+
# Reading dependencies from requirements.txt
43+
def read_requirements():
44+
deps = []
45+
try:
46+
with open("./requirements.txt", encoding="utf-8") as f:
47+
deps = [
48+
line.strip() for line in f if line.strip() and not line.startswith("#")
49+
]
50+
except FileNotFoundError:
51+
print(
52+
"Warning: 'requirements.txt' not found. No dependencies will be installed."
53+
)
54+
return deps
55+
56+
57+
metadata = retrieve_metadata()
58+
long_description = read_long_description()
59+
requirements = read_requirements()
60+
61+
# All dependencies are required for full functionality
62+
# No optional dependencies to ensure complete installation
63+
64+
setuptools.setup(
65+
name="deepcode",
66+
url=metadata["__url__"],
67+
version=metadata["__version__"],
68+
author=metadata["__author__"],
69+
description=metadata["__description__"],
70+
long_description=long_description,
71+
long_description_content_type="text/markdown",
72+
packages=setuptools.find_packages(
73+
exclude=("tests*", "docs*", ".history*", ".git*", ".ruff_cache*")
74+
), # Automatically find packages
75+
py_modules=["deepcode"], # Include the main deepcode.py module
76+
classifiers=[
77+
"Development Status :: 4 - Beta",
78+
"Programming Language :: Python :: 3",
79+
"License :: OSI Approved :: MIT License",
80+
"Operating System :: OS Independent",
81+
"Intended Audience :: Developers",
82+
"Intended Audience :: Science/Research",
83+
"Topic :: Software Development :: Libraries :: Python Modules",
84+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
85+
"Topic :: Text Processing :: Linguistic",
86+
],
87+
python_requires=">=3.9",
88+
install_requires=requirements, # All dependencies are required
89+
include_package_data=True, # Includes non-code files from MANIFEST.in
90+
entry_points={
91+
"console_scripts": [
92+
"deepcode=deepcode:main", # Command line entry point
93+
],
94+
},
95+
project_urls={ # Additional project metadata
96+
"Documentation": metadata.get("__url__", ""),
97+
"Source": metadata.get("__url__", ""),
98+
"Tracker": f"{metadata.get('__url__', '')}/issues"
99+
if metadata.get("__url__")
100+
else "",
101+
},
102+
package_data={
103+
"deepcode": [
104+
"config/*.yaml",
105+
"prompts/*",
106+
"schema/*",
107+
"*.png",
108+
"*.md",
109+
],
110+
},
111+
)

0 commit comments

Comments
 (0)