Skip to content
Merged
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
43 changes: 40 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ executors:
version:
type: string
docker:
- image: python:<< parameters.version >>-alpine
- image: python:<< parameters.version >>-buster
- image: postgres:11.0
environment:
POSTGRES_DB: 'psqlextra'
Expand All @@ -22,11 +22,11 @@ commands:
steps:
- run:
name: Install packages
command: apk add postgresql-libs gcc musl-dev postgresql-dev git
command: apt-get update && apt-get install -y --no-install-recommends postgresql-client-11 libpq-dev build-essential git

- run:
name: Install Python packages
command: pip install --progress-bar off .[<< parameters.extra >>]
command: pip install --progress-bar off '.[<< parameters.extra >>]'

run-tests:
parameters:
Expand Down Expand Up @@ -121,6 +121,30 @@ jobs:
name: Verify
command: python setup.py verify

publish:
executor:
name: python
version: "3.9"
steps:
- checkout
- install-dependencies:
extra: publish
- run:
name: Set version number
command: echo "__version__ = \"${CIRCLE_TAG:1}\"" > psqlextra/_version.py
- run:
name: Build package
command: python -m build
- run:
name: Publish package
command: >
python -m twine upload
--username "${PYPI_REPO_USERNAME}"
--password "${PYPI_REPO_PASSWORD}"
--verbose
--non-interactive
--disable-progress-bar
dist/*

workflows:
version: 2
Expand All @@ -132,3 +156,16 @@ workflows:
- test-python39
- test-python310
- analysis
- publish:
requires:
- test-python36
- test-python37
- test-python38
- test-python39
- test-python310
- analysis
filters:
branches:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+$/
11 changes: 11 additions & 0 deletions psqlextra/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import django

from ._version import __version__

if django.VERSION < (3, 2): # pragma: no cover
default_app_config = "psqlextra.apps.PostgresExtraAppConfig"

__all__ = [
"default_app_config",
"__version__",
]
else:
__all__ = [
"__version__",
]
1 change: 1 addition & 0 deletions psqlextra/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.0.4"
19 changes: 17 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from setuptools import find_packages, setup

exec(open("psqlextra/_version.py").read())


class BaseCommand(distutils.cmd.Command):
user_options = []
Expand Down Expand Up @@ -36,7 +38,7 @@ def run(self):

setup(
name="django-postgres-extra",
version="2.0.4",
version=__version__,
packages=find_packages(exclude=["tests"]),
include_package_data=True,
license="MIT License",
Expand Down Expand Up @@ -90,10 +92,23 @@ def run(self):
"isort==5.10.0",
"docformatter==1.4",
],
"publish": [
"build==0.7.0",
"twine==3.7.1",
],
},
cmdclass={
"lint": create_command(
"Lints the code", [["flake8", "setup.py", "psqlextra", "tests"]]
"Lints the code",
[
[
"flake8",
"--builtin=__version__",
"setup.py",
"psqlextra",
"tests",
]
],
),
"lint_fix": create_command(
"Lints the code",
Expand Down