Skip to content

Commit

Permalink
move to a more standard folder layout (#83)
Browse files Browse the repository at this point in the history
Co-authored-by: Javier Cordero <[email protected]>
  • Loading branch information
jneight and Javier Cordero authored Jun 6, 2024
1 parent eeb1a92 commit 8d7ad4a
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_psycopg2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ jobs:
- run: pip install psycopg2
- run: pip install psycogreen
- run: pip install gevent
- run: python setup.py -q install
- run: pip install .
- run: python runtests_psycopg2.py
2 changes: 1 addition & 1 deletion .github/workflows/ci_psycopg3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ jobs:
- run: pip install django==${{ matrix.django-version}}
- run: pip install psycopg[binary]
- run: pip install gevent
- run: python setup.py -q install
- run: pip install .
- run: python runtests_psycopg3.py
10 changes: 6 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install hatch
- name: Build package
run: python -m build
- name: Test package
run: hatch run test
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
uses: pypa/gh-action-pypi-publish@v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.0.4

- Fix package

## 4.0.3

- Support for psycopg3

## 4.0.2

- Fixed eventlet rlock using as context manager, issue #73, @StuBz211
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE AUTHORS.rst README.md
recursive-include django-db-geventpool *
recursive-exclude * *.pyc *.swp
prune django_db_geventpoll/.ropeproject
prune django_db_geventpool/.ropeproject
1 change: 1 addition & 0 deletions django_db_geventpool/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = 'v4.0.4'
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "django-db-geventpool"
dynamic = ["version"]
description = "Add a DB connection pool using gevent to django"
readme = "README.md"
license = "Apache-2.0"
authors = [
{ name = "Javier Cordero Martinez", email = "[email protected]" },
]
classifiers = [
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]
dependencies = [
"django>=3.1",
]

[project.urls]
Homepage = "https://github.com/jneight/django-db-geventpool"

[tool.hatch.version]
path = "django_db_geventpool/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/django_db_geventpool",
]
40 changes: 0 additions & 40 deletions setup.py

This file was deleted.

5 changes: 2 additions & 3 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def test_multiple_connections(count):
print("Test {0} starts".format(count))
for x in range(0, 20):
assert len(TestModel.objects.all()) == 1
assert not TestModel.objects.exists()
print("Test {0} ends".format(count))


Expand All @@ -29,9 +29,8 @@ def test_model_save(self):
self.assertEqual(data[key], getattr(obj, key))

def test_connections(self):
TestModel.objects.create()
greenlets = []

for x in range(0, 50):
greenlets.append(gevent.spawn(test_multiple_connections, x))
gevent.joinall(greenlets)
gevent.joinall(greenlets, raise_error=True)
9 changes: 0 additions & 9 deletions tox.ini

This file was deleted.

0 comments on commit 8d7ad4a

Please sign in to comment.