Skip to content

Commit 931ce05

Browse files
authored
Merge pull request #10 from dapper91/dev
- code reformatted - pipenv substituted by poetry - mypy checker added - python 3.10, 3.11 support added - dev dependencies updated
2 parents 217346e + 677d771 commit 931ce05

File tree

15 files changed

+244
-244
lines changed

15 files changed

+244
-244
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
max-line-length = 130
2+
max-line-length = 120
33
per-file-ignores =
44
crontools/*__init__.py: F401

.github/workflows/release.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ jobs:
1616
python-version: '3.x'
1717
- name: Install dependencies
1818
run: |
19-
python -m pip install --upgrade pip
20-
pip install setuptools wheel twine
19+
python -m pip install --upgrade pip poetry
20+
poetry install
2121
- name: Build and publish
22-
env:
23-
TWINE_USERNAME: __token__
24-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2522
run: |
26-
python setup.py sdist
27-
twine upload dist/*
23+
poetry build
24+
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}

.github/workflows/test.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: [3.7, 3.8, 3.9]
17+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1818
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: ${{ matrix.python-version }}
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install pipenv --upgrade
28-
pipenv install --python ${{ matrix.python-version }} --dev
29-
- name: Run linter
30-
run: pipenv run flake8 .
31-
- name: Run tests
32-
run: PYTHONPATH="$(pwd):$PYTHONPATH" pipenv run py.test --cov=crontools --cov-report=xml tests
33-
- name: Upload coverage to Codecov
34-
uses: codecov/codecov-action@v1
35-
with:
36-
token: ${{ secrets.CODECOV_TOKEN }}
37-
files: ./coverage.xml
38-
flags: unittests
39-
fail_ci_if_error: true
19+
- uses: actions/checkout@v2
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install poetry
28+
poetry install --no-root
29+
- name: Run pre-commit hooks
30+
run: poetry run pre-commit run --hook-stage merge-commit --all-files
31+
- name: Run tests
32+
run: PYTHONPATH="$(pwd):$PYTHONPATH" poetry run py.test --cov=crontools --cov-report=xml tests
33+
- name: Upload coverage to Codecov
34+
uses: codecov/codecov-action@v1
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
37+
files: ./coverage.xml
38+
flags: unittests
39+
fail_ci_if_error: true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ dmypy.json
130130

131131
.idea/
132132

133-
Pipfile.lock
133+
poetry.lock

.pre-commit-config.yaml

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,74 @@
1+
default_stages:
2+
- commit
3+
- merge-commit
4+
15
repos:
26
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
7+
rev: v4.4.0
48
hooks:
5-
- id: check-docstring-first
6-
stages:
7-
- commit
8-
- push
9-
- id: check-merge-conflict
10-
stages:
11-
- push
9+
- id: check-yaml
10+
- id: check-toml
1211
- id: trailing-whitespace
13-
stages:
14-
- commit
15-
- push
1612
- id: end-of-file-fixer
1713
stages:
1814
- commit
19-
- push
2015
- id: mixed-line-ending
16+
name: fix line ending
2117
stages:
2218
- commit
23-
- push
2419
args:
2520
- --fix=lf
26-
- id: no-commit-to-branch
21+
- id: mixed-line-ending
22+
name: check line ending
23+
stages:
24+
- merge-commit
25+
args:
26+
- --fix=no
27+
- repo: https://github.com/asottile/add-trailing-comma
28+
rev: v2.4.0
29+
hooks:
30+
- id: add-trailing-comma
2731
stages:
2832
- commit
2933
- repo: https://github.com/pre-commit/mirrors-autopep8
30-
rev: v1.5.5
34+
rev: v2.0.1
3135
hooks:
3236
- id: autopep8
3337
stages:
3438
- commit
35-
- push
3639
args:
37-
- --max-line-length=130
3840
- --diff
39-
- repo: https://github.com/asottile/add-trailing-comma
40-
rev: v2.1.0
41+
- repo: https://github.com/pycqa/flake8
42+
rev: 5.0.4
4143
hooks:
42-
- id: add-trailing-comma
44+
- id: flake8
45+
- repo: https://github.com/pycqa/isort
46+
rev: 5.11.5
47+
hooks:
48+
- id: isort
49+
name: fix import order
4350
stages:
4451
- commit
45-
- push
46-
- repo: https://gitlab.com/pycqa/flake8
47-
rev: 3.9.0
52+
args:
53+
- --line-length=120
54+
- --multi-line=9
55+
- --project=crontools
56+
- id: isort
57+
name: check import order
58+
stages:
59+
- merge-commit
60+
args:
61+
- --check-only
62+
- --line-length=120
63+
- --multi-line=9
64+
- --project=crontools
65+
- repo: https://github.com/pre-commit/mirrors-mypy
66+
rev: v1.0.1
4867
hooks:
49-
- id: flake8
68+
- id: mypy
5069
stages:
5170
- commit
52-
- push
71+
name: mypy
72+
pass_filenames: false
73+
args: ["--package", "crontools"]
74+
additional_dependencies: ["types-tzlocal"]

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
=========
33

4+
5+
0.1.6 (2023-02-25)
6+
------------------
7+
8+
- pipenv substituted by poetry
9+
- mypy checker added
10+
- python 3.10, 3.11 support added
11+
12+
413
0.1.5 (2022-04-24)
514
------------------
615

Pipfile

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

README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
crontools
33
=========
44

5-
.. image:: https://github.com/dapper91/crontools/actions/workflows/test.yml/badge.svg
5+
.. image:: https://static.pepy.tech/personalized-badge/crontools?period=month&units=international_system&left_color=grey&right_color=orange&left_text=Downloads/month
6+
:target: https://pepy.tech/project/crontools
7+
:alt: Downloads/month
8+
.. image:: https://github.com/dapper91/crontools/actions/workflows/test.yml/badge.svg?branch=master
69
:target: https://github.com/dapper91/crontools/actions/workflows/test.yml
710
:alt: Build status
811
.. image:: https://img.shields.io/pypi/l/crontools.svg

crontools/__about__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
__description__ = 'Python cron tools'
33
__url__ = 'https://github.com/dapper91/crontools'
44

5-
__version__ = '0.1.5'
5+
__version__ = '0.1.6'
66

77
__author__ = 'Dmitry Pershin'
8-
__email__ = '[email protected]'
8+
__email__ = '[email protected]'
99

1010
__license__ = 'Public Domain License'

crontools/__init__.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,10 @@
22
Python cron tools.
33
"""
44

5-
from .crontab import Crontab
6-
from .crontab import Range, SecondsRange, MinuteRange, HourRange, MonthdayRange, MonthRange, WeekdayRange, YearRange
7-
from .crontab import Field, SecondsField, MinuteField, HourField, MonthdayField, MonthField, WeekdayField, YearField, DayField
8-
9-
10-
from .__about__ import (
11-
__title__,
12-
__description__,
13-
__url__,
14-
__version__,
15-
__author__,
16-
__email__,
17-
__license__,
18-
)
5+
from .__about__ import __author__, __description__, __email__, __license__, __title__, __url__, __version__
6+
from .crontab import Crontab, DayField, Field, HourField, HourRange, MinuteField, MinuteRange, MonthdayField
7+
from .crontab import MonthdayRange, MonthField, MonthRange, Range, SecondsField, SecondsRange, WeekdayField
8+
from .crontab import WeekdayRange, YearField, YearRange
199

2010
__all__ = [
2111
'__title__',

0 commit comments

Comments
 (0)