Skip to content

Commit 534ef71

Browse files
committed
moving CI to GHA
1 parent ce31211 commit 534ef71

File tree

10 files changed

+66
-50
lines changed

10 files changed

+66
-50
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
[run]
22
omit = */tests/*,*/conftest.py
3+
relative_files = True
4+
5+
[report]
6+
show_missing = true
7+
precision = 2

.coveralls.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: migrant
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install tox tox-gh-actions
24+
- name: Test with tox
25+
run: tox
26+
- name: Coveralls
27+
uses: AndreMiras/coveralls-python-action@develop
28+
with:
29+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitlab-ci.yml

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

.travis.yml

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

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
1.5.1 (unreleased)
55
------------------
66

7-
- Nothing changed yet.
7+
- Moving CI to github actions
88

99

1010
1.5.0 (2023-01-24)

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Migrant
33
=======
44

5-
.. image:: https://travis-ci.org/Shoobx/migrant.png?branch=master
6-
:target: https://travis-ci.org/Shoobx/migrant
5+
.. image:: https://github.com/Shoobx/migrant/actions/workflows/test.yml/badge.svg
6+
:target: https://github.com/Shoobx/migrant/actions
77

88
.. image:: https://coveralls.io/repos/github/Shoobx/migrant/badge.svg?branch=master
99
:target: https://coveralls.io/github/Shoobx/migrant?branch=master

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ def read_file(filename):
2525
"Intended Audience :: Developers",
2626
"Programming Language :: Python",
2727
"Programming Language :: Python :: 3",
28-
"Programming Language :: Python :: 3.6",
2928
"Programming Language :: Python :: 3.7",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
3033
"Programming Language :: Python :: Implementation :: CPython",
3134
"Natural Language :: English",
3235
"Operating System :: OS Independent",
@@ -39,7 +42,6 @@ def read_file(filename):
3942
extras_require=dict(test=["coverage", "mock"],),
4043
package_data = {'migrant': ['py.typed']},
4144
install_requires=[
42-
"configparser ; python_version<'3.0'", # Py3 configparser backport.
4345
"setuptools",
4446
],
4547
entry_points={

src/migrant/engine.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2014 by Shoobx, Inc.
44
#
55
###############################################################################
6-
from typing import TypeVar, Dict, List, Tuple, Generic
6+
from typing import Optional, TypeVar, Dict, List, Tuple, Generic
77
import logging
88
import multiprocessing
99
import functools
@@ -28,7 +28,7 @@ def __init__(
2828
repository: Repository,
2929
config: Dict[str, str],
3030
dry_run: bool = False,
31-
processes: int = None,
31+
processes: Optional[int] = None,
3232
) -> None:
3333
self.backend = backend
3434
self.repository = repository
@@ -37,7 +37,7 @@ def __init__(
3737
self.config = config
3838
self.processes = processes or multiprocessing.cpu_count()
3939

40-
def status(self, target_id: str = None) -> int:
40+
def status(self, target_id: Optional[str] = None) -> int:
4141
"""Return number of migration actions to be performed to
4242
upgrade to target_id"""
4343
target_id = self.pick_rev_id(target_id)
@@ -71,7 +71,7 @@ def _update(self, db: DBN, target_id: str) -> None:
7171
self.backend.cleanup(cdb)
7272
log.info(f"{_pname()}: Migration completed for {cdb}")
7373

74-
def update(self, target_id: str = None) -> None:
74+
def update(self, target_id: Optional[str] = None) -> None:
7575
target_id = self.pick_rev_id(target_id)
7676
conns = self.backend.generate_connections()
7777

@@ -85,7 +85,7 @@ def update(self, target_id: str = None) -> None:
8585
for _ in pool.imap_unordered(f, conns):
8686
pass
8787

88-
def test(self, target_id: str = None) -> None:
88+
def test(self, target_id: Optional[str] = None) -> None:
8989
target_id = self.pick_rev_id(target_id)
9090
conns = self.backend.generate_test_connections()
9191

@@ -141,7 +141,7 @@ def initialize_db(self, db: DBC, initial_revid: str):
141141
f"{_pname()}: Initialized migrations for {db}. Assuming database is at {sid}"
142142
)
143143

144-
def pick_rev_id(self, rev_id: str = None) -> str:
144+
def pick_rev_id(self, rev_id: Optional[str] = None) -> str:
145145
if rev_id is None:
146146
# Pick latest one
147147
rev_id = self.script_ids[-1]

tox.ini

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
[tox]
2-
envlist = py36, py37, py38
2+
envlist = py37, py38, py39, py310, py311, mypy
3+
4+
[gh-actions]
5+
python =
6+
3.7: py37
7+
3.8: py38
8+
3.9: py39
9+
3.10: py310, mypy
10+
3.11: py311
311

412
[testenv]
5-
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
613
commands =
714
py.test \
8-
-rw --cov=src --cov-report=term-missing --cov-report=html \
9-
-s --tb=native
15+
-rw --cov=src --cov-report=term-missing --cov-report=term-missing -s --tb=native
1016
deps =
11-
pytest
1217
.[test]
18+
pytest
1319
pytest-cov
20+
21+
[testenv:mypy]
22+
description = Run mypy
23+
deps =
24+
mypy
25+
{[testenv]deps}
26+
commands =
27+
mypy --install-types --non-interactive {toxinidir}/src

0 commit comments

Comments
 (0)