Skip to content

Commit 0f05b6d

Browse files
authored
Merge pull request #8 from Code0x58/codex/migrate-to-github-actions-with-testing-and-publishing
Migrate to GitHub Actions
2 parents 2196c8e + ed3dc5e commit 0f05b6d

File tree

6 files changed

+68
-42
lines changed

6 files changed

+68
-42
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.x'
16+
- name: Build package
17+
run: |
18+
python -m pip install --upgrade pip build
19+
python -m build
20+
- name: Publish to PyPI
21+
uses: pypa/gh-action-pypi-publish@v1
22+
with:
23+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-22.04
11+
strategy:
12+
matrix:
13+
# the range of versions covered is much less than those claimed to be supported, just
14+
# because it would take getting hands on for CI to cover the old versions that Travis
15+
# previously covered, back when those versions were contemporary.
16+
python-version: ["3.7", "3.13", "3.14-dev"]
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install . pytest pytest-cov
27+
- name: Run tests
28+
run: |
29+
pytest -vv --cov=jsonstore
30+
- name: Upload coverage
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: coverage-${{ matrix.python-version }}
34+
path: .coverage

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

README.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|PyPi Package| |Build Status| |Codacy Rating| |Coverage Report|
1+
|PyPi Package|
22

33
jsonstore
44
=========
@@ -12,11 +12,8 @@ flexible than the
1212
`configparser <https://docs.python.org/3/library/configparser.html>`__
1313
module which is included with Python.
1414

15-
This works is tested and working on Python 2.7+ and Python 3.3+. It will
16-
not work on 2.6 or lower, but is expected to work on 3.0-3.2. The tests
17-
do not work in 3.2.6 due to
18-
`mistreating <https://travis-ci.org/Code0x58/python-jsonstore/jobs/198150401>`__
19-
the 💩 when parsing the test code. This is also tested on pypy and pypy3.
15+
This works is tested and working on Python 2.7 and Python 3.6+. It will
16+
not work on 2.6 or lower. The tests are also executed on PyPy.
2017

2118
Examples
2219
--------
@@ -110,11 +107,6 @@ file until all of the transactions have been closed.
110107
# here we see the value that was saved previously
111108
assert store.value == 1
112109
113-
.. |Build Status| image:: https://travis-ci.org/Code0x58/python-jsonstore.svg?branch=master
114-
:target: https://travis-ci.org/Code0x58/python-jsonstore
115-
.. |Codacy Rating| image:: https://api.codacy.com/project/badge/Grade/37ea488773444de59469a3775be83faf
116-
:target: https://www.codacy.com/app/evilumbrella-github/python-jsonstore?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Code0x58/python-jsonstore&amp;utm_campaign=Badge_Grade
110+
117111
.. |PyPi Package| image:: https://badge.fury.io/py/python-jsonstore.svg
118112
:target: https://pypi.org/project/python-jsonstore/
119-
.. |Coverage Report| image:: https://codecov.io/gh/Code0x58/python-jsonstore/branch/master/graph/badge.svg
120-
:target: https://codecov.io/gh/Code0x58/python-jsonstore

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
Programming Language :: Python :: 3.6
3333
Programming Language :: Python :: 3.7
3434
Programming Language :: Python :: 3.8
35+
Programming Language :: Python :: 3.9
36+
Programming Language :: Python :: 3.10
37+
Programming Language :: Python :: 3.11
38+
Programming Language :: Python :: 3.12
39+
Programming Language :: Python :: 3.13
3540
Programming Language :: Python :: Implementation :: CPython
3641
Programming Language :: Python :: Implementation :: PyPy
3742
Topic :: Database

test_jsonstore.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ def test_del(self):
216216
del self.store["list", 1]
217217

218218
self.store.dict = {}
219-
with self.assertRaises(TypeError):
219+
# somewhere after python 3.9 this went from a TypeError to a KeyError
220+
with self.assertRaises((TypeError, KeyError)):
220221
del self.store["dict", slice("a")]
221222

222223
def test_context_and_deserialisation(self):

0 commit comments

Comments
 (0)