diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3d4d7e..d22fd26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,10 +19,12 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.9" - - name: Install dependencies + - name: Install uv and dependencies run: | - python -m pip install --upgrade pip - pip install -r dev-requirements.txt + curl -LsSf https://astral.sh/uv/install.sh | sh + source "$HOME/.cargo/env" + # Install build/dev dependencies needed for release + uv pip install --system .[dev] - name: Build and release run: | python -m build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77ef49c..d40eb28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,12 +43,14 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install uv and dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r dev-requirements.txt - pip install Django==${{ matrix.django-version }} + curl -LsSf https://astral.sh/uv/install.sh | sh + source "$HOME/.cargo/env" + # Install main dependencies, dev dependencies, and the specific Django version for the matrix + # Using -e .[dev] installs the current package in editable mode with dev extras + uv pip install --system -e .[dev] + uv pip install --system Django==${{ matrix.django-version }} - name: Run tests run: | ./check-lint.sh diff --git a/README.md b/README.md index 6585c3d..7f20d68 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Supports only Postgres as of now ## Installation ```bash -pip install django-querysets-single-query-fetch +uv pip install django-querysets-single-query-fetch ``` ## Usage diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 5847c9d..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -ruff==0.3.7 -model-bakery==1.17.0 -build==1.2.1 -twine==5.0.0 -mypy==1.10.0 -mypy-extensions==1.0.0 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1c95207 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ["setuptools>=42"] +build-backend = "setuptools.build_meta" + +[project] +name = "django-querysets-single-query-fetch" +version = "0.0.12" +description = "Execute multiple Django querysets in a single SQL query" +readme = "README.md" +requires-python = ">=3.9" +license = "Apache-2.0" # SPDX identifier +authors = [ + { name = "Nishant Singh", email = "nishant.singh@mydukaan.io" } +] +classifiers = [ + "Development Status :: 4 - Beta", # Assuming based on version < 1.0 + "Framework :: Django", + "Framework :: Django :: 4.0", + "Framework :: Django :: 4.1", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", + "Framework :: Django :: 5.1", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Database", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "django>=4.0,<5.2", # From setup.py + "psycopg2==2.9.9" # Keep specific version for now +] + +[project.urls] +Homepage = "https://github.com/iNishant/django-querysets-single-query-fetch" +Repository = "https://github.com/iNishant/django-querysets-single-query-fetch" + +[project.optional-dependencies] +dev = [ + "ruff==0.3.7", + "model-bakery==1.17.0", + "build==1.2.1", + "twine==5.0.0", + "mypy==1.10.0", + "mypy-extensions==1.0.0" +] + +[tool.ruff] + +[tool.setuptools.packages.find] +include = ["django_querysets_single_query_fetch*"] +exclude = ["testapp*", "testproject*"] + +# Assuming default ruff config unless specified elsewhere + +[tool.mypy] +# Assuming default mypy config unless specified elsewhere diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e819eb5..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -django==4.2 -psycopg2==2.9.9 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 1154d67..0000000 --- a/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -import setuptools - -setuptools.setup( - name="django_querysets_single_query_fetch", - version="0.0.12", - description="Execute multiple Django querysets in a single SQL query", - long_description="Utility which executes multiple Django querysets over a single network/query call and returns results which would have been returned in normal evaluation of querysets", - author="Nishant Singh", - author_email="nishant.singh@mydukaan.io", - license="Apache Software License", - packages=["django_querysets_single_query_fetch"], - zip_safe=False, - install_requires=["django>=4.0,<5.2"], - python_requires=">=3.9", - include_package_data=True, - package_data={}, -)