Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[bumpversion]
current_version = 0.6.4-dev9
current_version = 0.6.4-dev10
tag_name = {new_version}
files = pyproject.toml doc/conf.py dql/cli.py
files = pyproject.toml uv.lock doc/conf.py dql/cli.py
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}-{release}{build}
{major}.{minor}.{patch}
serialize =
{major}.{minor}.{patch}-{release}{build}
{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = prod
first_value = dev
values =
dev
prod
values =
dev
prod

[bumpversion:part:build]
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ indent_size = 4
[*.{js,json,yml}]
indent_style = space
indent_size = 2

[*.{toml,cfg}]
indent_style = space
indent_size = 4
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
_envdir=$(dirname "$1")
source $_envdir/dql_env/bin/activate
source $_envdir/.venv/bin/activate
20 changes: 19 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
layout python
# Use uv for Python environment management
if ! command -v uv >/dev/null 2>&1; then
echo "uv is not installed. Please install uv first:"
echo "curl -LsSf https://astral.sh/uv/install.sh | sh"
exit 1
fi

# Create virtual environment if it doesn't exist
if [ ! -d ".venv" ]; then
uv venv
fi

# Activate the virtual environment
source .venv/bin/activate

# Install dependencies if uv.lock exists
if [ -f "uv.lock" ]; then
uv sync --dev
fi
30 changes: 19 additions & 11 deletions .github/workflows/code-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v1
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Running lint with tox
uses: ymyzk/run-tox-gh-actions@main
with:
tox-args:
-e lint
- name: Install dependencies
run: uv sync --dev
- name: Run linting
run: uv run task lint

test-job:
needs: lint-job
Expand All @@ -43,18 +46,23 @@ jobs:
java-version: '21'

- name: Install & start DynamoDB Local
run: ./travisci/install_dynamodb_local.sh background
run: ./scripts/install_dynamodb_local.sh background

- name: Install uv
uses: astral-sh/setup-uv@v1
with:
version: "latest"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Running tests for ${{ matrix.python-version }} with tox
uses: ymyzk/run-tox-gh-actions@main
with:
tox-args:
-e test
- name: Install dependencies
run: uv sync --dev

- name: Run tests
run: uv run task test

# publish-job:
# name: Publish to PyPI and upload binary
Expand Down
6 changes: 0 additions & 6 deletions .python-version

This file was deleted.

3 changes: 3 additions & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=22.0.2-amzn
24 changes: 23 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,29 @@ Changelog

--------------------------------------------------------------------------------

0.6.4-dev8 (Current Development)
0.6.4-dev10 (Current Development)
--------------------------------
* Updated: remove python 3.6, 3.7, 3.8 official support.
* Updated: use ``gnureadline`` instead of builtin readline for better cross-platform, cross-python distribution support.

* Chore: migrate build/testing env from ``[tox,pyenv,poetry]`` to ``uv``
* Chore: dev & test dependencies are now in ``pyproject.toml``



0.6.4-dev9
--------------------------------
* Added: rich format will now display 15 columns and then only display column headers in a separate line.

* Fix: boolean keyword not parsing properly
* Fix: minor fix w.r.t. error handling in a specific SyntaxError case
* Fix: minor type checking fix

* Chore: latest github runner
* Chore: upgrade python 3.9.19 to 3.9.21


0.6.4-dev8
--------------------------------
* Added: Added colorization for ``json`` formatter
* Added: ``rich`` formatter for query results
Expand Down
137 changes: 125 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@ Installation can be done in a variety of ways
* With pip: ``pip install dql`` (To get the official version)
* If you want my development version, see branch `v-next`_

Prerequisites for development version: ``pipx, pyenv``
Prerequisites for development version: ``uv``

Installing from remote source code::

# 1. Install python
pyenv install 3.9.21
# 2. Set active python environment
pyenv shell 3.9.21
# 3. Install dql
pipx install --python python3.9 git+https://github.com/jspreddy/dql.git@v-next
# 1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. Install dql
uv tool install --python 3.9.21 git+https://github.com/jspreddy/dql.git@v-next

Install from local source code::

# 1. Clone repo,
git clone https://github.com/jspreddy/dql.git
# 2. checkout branch `v-next`
git checkout v-next
# 3. init python environment
pyenv install 3.9.21
pyenv shell 3.9.21
# 4. editable install
pipx install --python python3.9 -e .
# 3. Install dependencies and create virtual environment
uv sync --dev
uv venv
# 4. Activate virtual environment
source .venv/bin/activate
# 5. Install in editable mode
uv pip install -e .


Examples
Expand Down Expand Up @@ -96,3 +96,116 @@ And don't forget to use ``help``!
Developer/Maintainer Guide:
---------------------------
`See here for developer guide for v-next branch. <https://github.com/jspreddy/dql/blob/v-next/doc/topics/develop.rst>`

Migration to uv:
----------------
This project has been migrated from Poetry + pyenv + virtualenv to `uv <https://docs.astral.sh/uv/>`_, a fast Python package manager and installer.

For detailed migration information, see `UV_MIGRATION.md <UV_MIGRATION.md>`_.

Quick start for developers:

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and setup
git clone https://github.com/jspreddy/dql.git
cd dql
git checkout v-next

# Install dependencies
uv sync --dev
uv venv
source .venv/bin/activate

# Run tests
uv run task test

# Run linting
uv run task lint

# Format code
uv run task format

## Complete Migration Plan: Poetry + pyenv + virtualenv → uv

I've created a comprehensive migration plan for your DQL project. Here's what has been implemented:

### 📁 Files Created/Modified

1. **`pyproject.toml`** - Updated with uv configuration
2. **`tox.ini`** - Modified to use uv instead of virtualenv-pyenv
3. **`.envrc`** - Updated to work with uv virtual environments
4. **`.github/workflows/code-workflows.yml`** - Updated CI/CD to use uv
5. **`migrate-to-uv.sh`** - Automated migration script
6. **`cleanup-old-tools.sh`** - Cleanup script for old configurations
7. **`UV_MIGRATION.md`** - Comprehensive migration guide
8. **`README.rst`** - Updated with uv installation instructions

### 🚀 Migration Steps

#### Phase 1: Preparation
1. **Install uv**: `curl -LsSf https://astral.sh/uv/install.sh | sh`
2. **Run migration script**: `./migrate-to-uv.sh`

#### Phase 2: Verification
1. **Test installation**: `uv run pytest tests`
2. **Test linting**: `uv run mypy dql tests bin/install.py`
3. **Verify CI/CD**: Push changes and check GitHub Actions

#### Phase 3: Cleanup (Optional)
1. **Remove old files**: `./cleanup-old-tools.sh`
2. **Update IDE settings** to use `.venv/bin/python`

### 🔄 Key Changes

| Component | Before | After |
|-----------|--------|-------|
| **Package Manager** | Poetry | uv |
| **Python Management** | pyenv | uv python |
| **Virtual Environment** | virtualenv | uv venv |
| **Lock File** | poetry.lock | uv.lock |
| **CI/CD** | tox + actions/setup-python | uv + astral-sh/setup-uv |

### 📋 New Commands

```bash
# Install dependencies
uv sync --dev

# Run commands
uv run pytest tests
uv run mypy dql tests bin/install.py

# Add dependencies
uv add requests
uv add --dev pytest-mock

# Create virtual environment
uv venv
```

### 🎯 Benefits

- **10-100x faster** dependency installation
- **Single tool** replaces multiple tools
- **Better dependency resolution**
- **Modern Rust-based architecture**
- **Simplified workflow**

### 📚 Documentation

- **`UV_MIGRATION.md`** - Complete migration guide
- **Updated README** - Quick start instructions
- **Migration scripts** - Automated setup

### ⚠️ Important Notes

1. **Backup files** are created during migration
2. **CI/CD pipeline** has been updated
3. **IDE configuration** may need updating
4. **Team members** should be notified of the change

The migration is designed to be **reversible** - you can always rollback to the previous setup if needed. All the necessary files and scripts are in place for a smooth transition to uv.

Would you like me to help you execute any specific part of this migration plan?
Loading
Loading