1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
|
version: 2.1
executors:
python:
parameters:
version:
type: string
docker:
- image: python:<< parameters.version >>-buster
- image: postgres:13.0
environment:
POSTGRES_DB: 'psqlextra'
POSTGRES_USER: 'psqlextra'
POSTGRES_PASSWORD: 'psqlextra'
commands:
install-dependencies:
parameters:
extra:
type: string
steps:
- run:
name: Install packages
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 >>]'
run-tests:
parameters:
pyversion:
type: integer
steps:
- run:
name: Run tests
command: tox --listenvs | grep ^py<< parameters.pyversion >> | circleci tests split | xargs -n 1 tox -e
environment:
DATABASE_URL: 'postgres://psqlextra:psqlextra@localhost:5432/psqlextra'
jobs:
test-python36:
executor:
name: python
version: "3.6"
steps:
- checkout
- install-dependencies:
extra: test
- run-tests:
pyversion: 36
test-python37:
executor:
name: python
version: "3.7"
steps:
- checkout
- install-dependencies:
extra: test
- run-tests:
pyversion: 37
test-python38:
executor:
name: python
version: "3.8"
steps:
- checkout
- install-dependencies:
extra: test
- run-tests:
pyversion: 38
test-python39:
executor:
name: python
version: "3.9"
steps:
- checkout
- install-dependencies:
extra: test
- run-tests:
pyversion: 39
test-python310:
executor:
name: python
version: "3.10"
steps:
- checkout
- install-dependencies:
extra: test
- run-tests:
pyversion: 310
test-python311:
executor:
name: python
version: "3.11"
steps:
- checkout
- install-dependencies:
extra: test
- run-tests:
pyversion: 311
- store_test_results:
path: reports
- run:
name: Upload coverage report
command: coveralls
analysis:
executor:
name: python
version: "3.9"
steps:
- checkout
- install-dependencies:
extra: analysis, test
- run:
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 "__token__"
--password "${PYPI_API_TOKEN}"
--verbose
--non-interactive
--disable-progress-bar
dist/*
workflows:
build:
jobs:
- test-python36:
filters:
tags:
only: /.*/
branches:
only: /.*/
- test-python37:
filters:
tags:
only: /.*/
branches:
only: /.*/
- test-python38:
filters:
tags:
only: /.*/
branches:
only: /.*/
- test-python39:
filters:
tags:
only: /.*/
branches:
only: /.*/
- test-python310:
filters:
tags:
only: /.*/
branches:
only: /.*/
- test-python311:
filters:
tags:
only: /.*/
branches:
only: /.*/
- analysis:
filters:
tags:
only: /.*/
branches:
only: /.*/
- publish:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
|