Skip to content

Commit 55e8529

Browse files
authored
Merge pull request #21 from tidesdb/refactor/cfoundation-setup-process
refactor(setup): optimize cfoundation setup process and improve documentation
2 parents 16404f8 + 5cfbdf6 commit 55e8529

3 files changed

Lines changed: 28 additions & 10 deletions

File tree

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ cd tidesdb-python
2727

2828
# Run the setup script
2929
./setup.sh
30+
31+
# Activate the virtual environment
32+
source venv/bin/activate # Your prompt should show (venv) at the beginning
3033
```
3134

3235
#### Windows
@@ -38,6 +41,10 @@ cd tidesdb-python
3841
3942
# Run the setup script
4043
.\setup.ps1
44+
45+
# Activate the virtual environment
46+
# For Windows (PowerShell or Command Prompt):
47+
venv\Scripts\activate # Your prompt should show (venv) at the beginning
4148
```
4249

4350
### Understanding the Setup Process
@@ -48,15 +55,20 @@ The installation process consists of several important steps:
4855
- The setup scripts automatically clone and configure the TidesDB C foundation (`cfoundation/`).
4956
- This component is crucial as it provides the core database functionality that the Python bindings interact with.
5057
- The scripts handle:
51-
- Cloning the C foundation repository
58+
- Cloning the C foundation repository (only essential files)
5259
- Configuring build options for optimal performance
5360
- Building and installing the C library
5461
- Integrating it seamlessly with the Python bindings
5562

5663
2. **Python Environment**
57-
- Creates a virtual environment for isolated package management
58-
- Installs all required Python dependencies
59-
- Sets up the Python package in development mode
64+
- The setup script automatically:
65+
- Creates a virtual environment for isolated package management
66+
- Installs all required Python dependencies
67+
- Sets up the Python package in development mode
68+
- After installation, you must manually activate the virtual environment:
69+
- For Linux/macOS: `source venv/bin/activate`
70+
- For Windows: `venv\Scripts\activate`
71+
- Once activated, your prompt should show (venv) at the beginning
6072

6173
#### Automated Setup Details
6274

setup.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ $ErrorActionPreference = "Stop"
44
# Define C library repository
55
$CLIB_REPO = "https://github.com/tidesdb/tidesdb"
66

7-
# Clone and set up C foundation
8-
Write-Host "Cloning TidesDB C foundation..."
9-
git clone $CLIB_REPO cfoundation
7+
# Clone with sparse checkout
8+
Write-Host "Cloning TidesDB C foundation (minimal)..."
9+
git clone --filter=blob:none --sparse $CLIB_REPO cfoundation
1010
Set-Location cfoundation
1111

12+
# Configure sparse checkout patterns
13+
git sparse-checkout set --no-cone '/*' '!artwork/' '!test/' '!.github/' '!CODE_OF_CONDUCT.md' '!CONTRIBUTING.md' '!LICENSE' '!README.md' '!SECURITY.md' '!.gitignore'
14+
1215
# Remove .git directory as it will be part of the main project
1316
Write-Host "Cleaning up git history..."
1417
Remove-Item -Recurse -Force .git

setup.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ set -e # Stop the script in case of error
55
# Define C library repository
66
CLIB_REPO="https://github.com/tidesdb/tidesdb"
77

8-
# Clone and set up C foundation
9-
echo "Cloning TidesDB C foundation..."
10-
git clone "$CLIB_REPO" cfoundation
8+
# Clone with sparse checkout
9+
echo "Cloning TidesDB C foundation (minimal)..."
10+
git clone --filter=blob:none --sparse "$CLIB_REPO" cfoundation
1111
cd cfoundation
1212

13+
# Configure sparse checkout patterns
14+
git sparse-checkout set --no-cone '/*' '!artwork/' '!test/' '!.github/' '!CODE_OF_CONDUCT.md' '!CONTRIBUTING.md' '!LICENSE' '!README.md' '!SECURITY.md' '!.gitignore'
15+
1316
# Remove .git directory as it will be part of the main project
1417
echo "Cleaning up git history..."
1518
rm -rf .git

0 commit comments

Comments
 (0)