Skip to content

Commit 8054ec3

Browse files
committed
👌 IMPROVE: Contribution
1 parent f2e3d59 commit 8054ec3

File tree

1 file changed

+33
-142
lines changed

1 file changed

+33
-142
lines changed

CONTRIBUTION.md

Lines changed: 33 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ This document provides instructions for setting up the development environment,
1414

1515
1. **Clone the repository**:
1616
```bash
17-
git clone https://github.com/LangbaseInc/langbase-sdk-python
18-
cd langbase-sdk-python
17+
git clone https://github.com/LangbaseInc/langbase-python-sdk
18+
cd langbase-python-sdk
1919
```
2020

2121
2. **Create and activate a virtual environment**:
@@ -31,8 +31,6 @@ This document provides instructions for setting up the development environment,
3131

3232
3. **Install development dependencies**:
3333
```bash
34-
pip install -e ".[dev]"
35-
# Or
3634
pip install -r requirements-dev.txt
3735
```
3836

@@ -48,12 +46,8 @@ This document provides instructions for setting up the development environment,
4846
black .
4947
isort .
5048
```
51-
52-
6. Run the tests:
53-
54-
## Running Tests
5549

56-
The SDK uses pytest for testing. To run the tests:
50+
6. Run the tests:
5751

5852
```bash
5953
# Run all tests
@@ -66,19 +60,9 @@ pytest tests/test_langbase.py
6660
pytest --cov=langbase
6761
```
6862

69-
## Building the Package
70-
71-
To build the package:
72-
73-
```bash
74-
python -m build
75-
```
76-
77-
This will create both source distributions and wheel distributions in the `dist/` directory.
7863

79-
## Testing the Package Locally
64+
## Running and Testing Examples Locally
8065

81-
You can test the package locally without publishing to PyPI:
8266

8367
```bash
8468
# Install in development mode
@@ -88,118 +72,50 @@ pip install -e .
8872
Then you can run examples:
8973

9074
```
91-
./venv/bin/python examples/pipes/pipes.run.py
92-
```
93-
94-
## Publishing to PyPI
95-
96-
### Prerequisites
97-
98-
- A PyPI account
99-
- twine package (`pip install twine`)
100-
101-
### Steps to Publish
102-
103-
1. **Make sure your package version is updated**:
104-
- Update the version number in `langbase/__init__.py`
105-
106-
2. **Build the package**:
107-
```bash
108-
python -m build
109-
```
110-
111-
If it doesn't work, try installing the latest version of `build`:
112-
113-
```bash
114-
pip install build
115-
```
116-
117-
And then run:
118-
119-
```bash
120-
./venv/bin/python -m build
121-
```
122-
123-
3. **Check the package**:
124-
```bash
125-
twine check dist/*
126-
```
127-
128-
4. **Upload to TestPyPI (optional but recommended)**:
129-
```bash
130-
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
131-
```
132-
133-
5. **Test the TestPyPI package**:
134-
```bash
135-
pip install --index-url https://test.pypi.org/simple/ langbase
136-
```
137-
138-
6. **Upload to PyPI**:
139-
```bash
140-
twine upload dist/*
141-
```
142-
143-
## Automating Releases with GitHub Actions
144-
145-
For automated releases, you can use GitHub Actions. Create a workflow file at `.github/workflows/publish.yml` with the following content:
146-
147-
```yaml
148-
name: Publish to PyPI
149-
150-
on:
151-
release:
152-
types: [published]
153-
154-
jobs:
155-
build-and-publish:
156-
runs-on: ubuntu-latest
157-
steps:
158-
- uses: actions/checkout@v3
159-
- name: Set up Python
160-
uses: actions/setup-python@v4
161-
with:
162-
python-version: '3.x'
163-
- name: Install dependencies
164-
run: |
165-
python -m pip install --upgrade pip
166-
pip install build twine
167-
- name: Build and publish
168-
env:
169-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
170-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
171-
run: |
172-
python -m build
173-
twine upload dist/*
75+
python examples/pipes/pipes.run.py
17476
```
17577

17678
## Project Structure
17779

17880
The project follows this structure:
17981

18082
```
181-
langbase-python/
182-
├── langbase/ # Main package
183-
│ ├── __init__.py # Package initialization
184-
│ ├── langbase.py # Main client implementation
185-
│ ├── request.py # HTTP request handling
186-
│ ├── errors.py # Error classes
187-
│ ├── types.py # Type definitions (not used)
188-
│ └── utils.py # Utility functions
189-
│ └── workflow.py # Workflow implementation
83+
langbase-python-sdk/
84+
├── langbase/ # Main package
85+
│ ├── __init__.py # Package initialization
86+
│ ├── errors.py # Error classes
87+
│ ├── helper.py # Helper functions
88+
│ ├── langbase.py # Main client implementation
89+
│ ├── request.py # HTTP request handling
90+
│ ├── types.py # Type definitions
91+
│ ├── utils.py # Utility functions
92+
│ └── workflow.py # Workflow implementation
19093
├── tests/ # Test package
19194
│ ├── __init__.py # Test package initialization
192-
│ ├── test_client.py # Tests for the client
193-
│ ├── test_request.py # Tests for request handling
95+
│ ├── conftest.py # Test configuration
19496
│ ├── test_errors.py # Tests for error classes
195-
│ └── test_utils.py # Tests for utility functions
97+
│ ├── test_langbase_client.py # Tests for the client
98+
│ ├── test_memories.py # Tests for memory functionality
99+
│ ├── test_pipes.py # Tests for pipes
100+
│ ├── test_threads.py # Tests for threads
101+
│ ├── test_tools.py # Tests for tools
102+
│ ├── test_utilities.py # Tests for utility functions
196103
│ └── test_workflow.py # Tests for workflow
197104
├── examples/ # Example scripts
198-
├── setup.py # Package setup script
105+
│ ├── agent/ # Agent examples
106+
│ ├── chunker/ # Chunker examples
107+
│ ├── embed/ # Embed examples
108+
│ ├── memory/ # Memory examples
109+
│ ├── parser/ # Parser examples
110+
│ ├── pipes/ # Pipe examples
111+
│ ├── threads/ # Thread examples
112+
│ ├── tools/ # Tool examples
113+
│ └── workflow/ # Workflow examples
199114
├── pyproject.toml # Project configuration
200115
├── requirements.txt # Package dependencies
201116
├── requirements-dev.txt # Development dependencies
202-
├── LICENSE # MIT license
117+
├── LICENCE # MIT license
118+
├── CONTRIBUTION.md # Contribution guidelines
203119
└── README.md # Main documentation
204120
```
205121

@@ -212,28 +128,3 @@ Contributions are welcome! Please feel free to submit a Pull Request.
212128
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
213129
4. Push to the branch (`git push origin feature/amazing-feature`)
214130
5. Open a Pull Request
215-
216-
## Troubleshooting
217-
218-
### Common Issues
219-
220-
1. **Package not found after installation**:
221-
- Make sure your virtual environment is activated
222-
- Try running `pip list` to confirm installation
223-
224-
2. **Build errors**:
225-
- Make sure you have the latest `build` package: `pip install --upgrade build`
226-
- Check for syntax errors in your code
227-
228-
3. **Test failures**:
229-
- Run specific failing tests to get more details
230-
- Check for API key issues if integration tests are failing
231-
232-
### Getting Help
233-
234-
If you encounter issues not covered here, please open an issue on GitHub with detailed information about the problem, including:
235-
236-
- Your Python version
237-
- Your operating system
238-
- Any error messages
239-
- Steps to reproduce the issue

0 commit comments

Comments
 (0)