Skip to content

Commit

Permalink
Merge pull request #10 from dapper91/dev
Browse files Browse the repository at this point in the history
- code reformatted
- pipenv substituted by poetry
- mypy checker added
- python 3.10, 3.11 support added
- dev dependencies updated
  • Loading branch information
dapper91 authored Feb 25, 2023
2 parents 217346e + 677d771 commit 931ce05
Show file tree
Hide file tree
Showing 15 changed files with 244 additions and 244 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
max-line-length = 130
max-line-length = 120
per-file-ignores =
crontools/*__init__.py: F401
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ jobs:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python -m pip install --upgrade pip poetry
poetry install
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist
twine upload dist/*
poetry build
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
44 changes: 22 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv --upgrade
pipenv install --python ${{ matrix.python-version }} --dev
- name: Run linter
run: pipenv run flake8 .
- name: Run tests
run: PYTHONPATH="$(pwd):$PYTHONPATH" pipenv run py.test --cov=crontools --cov-report=xml tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
fail_ci_if_error: true
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root
- name: Run pre-commit hooks
run: poetry run pre-commit run --hook-stage merge-commit --all-files
- name: Run tests
run: PYTHONPATH="$(pwd):$PYTHONPATH" poetry run py.test --cov=crontools --cov-report=xml tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ dmypy.json

.idea/

Pipfile.lock
poetry.lock
72 changes: 47 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,74 @@
default_stages:
- commit
- merge-commit

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: check-docstring-first
stages:
- commit
- push
- id: check-merge-conflict
stages:
- push
- id: check-yaml
- id: check-toml
- id: trailing-whitespace
stages:
- commit
- push
- id: end-of-file-fixer
stages:
- commit
- push
- id: mixed-line-ending
name: fix line ending
stages:
- commit
- push
args:
- --fix=lf
- id: no-commit-to-branch
- id: mixed-line-ending
name: check line ending
stages:
- merge-commit
args:
- --fix=no
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
stages:
- commit
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.5.5
rev: v2.0.1
hooks:
- id: autopep8
stages:
- commit
- push
args:
- --max-line-length=130
- --diff
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.1.0
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: add-trailing-comma
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.11.5
hooks:
- id: isort
name: fix import order
stages:
- commit
- push
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
args:
- --line-length=120
- --multi-line=9
- --project=crontools
- id: isort
name: check import order
stages:
- merge-commit
args:
- --check-only
- --line-length=120
- --multi-line=9
- --project=crontools
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
hooks:
- id: flake8
- id: mypy
stages:
- commit
- push
name: mypy
pass_filenames: false
args: ["--package", "crontools"]
additional_dependencies: ["types-tzlocal"]
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========


0.1.6 (2023-02-25)
------------------

- pipenv substituted by poetry
- mypy checker added
- python 3.10, 3.11 support added


0.1.5 (2022-04-24)
------------------

Expand Down
13 changes: 0 additions & 13 deletions Pipfile

This file was deleted.

5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
crontools
=========

.. image:: https://github.com/dapper91/crontools/actions/workflows/test.yml/badge.svg
.. image:: https://static.pepy.tech/personalized-badge/crontools?period=month&units=international_system&left_color=grey&right_color=orange&left_text=Downloads/month
:target: https://pepy.tech/project/crontools
:alt: Downloads/month
.. image:: https://github.com/dapper91/crontools/actions/workflows/test.yml/badge.svg?branch=master
:target: https://github.com/dapper91/crontools/actions/workflows/test.yml
:alt: Build status
.. image:: https://img.shields.io/pypi/l/crontools.svg
Expand Down
4 changes: 2 additions & 2 deletions crontools/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
__description__ = 'Python cron tools'
__url__ = 'https://github.com/dapper91/crontools'

__version__ = '0.1.5'
__version__ = '0.1.6'

__author__ = 'Dmitry Pershin'
__email__ = 'dapper91@mail.ru'
__email__ = 'dapper1291@gmail.com'

__license__ = 'Public Domain License'
18 changes: 4 additions & 14 deletions crontools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@
Python cron tools.
"""

from .crontab import Crontab
from .crontab import Range, SecondsRange, MinuteRange, HourRange, MonthdayRange, MonthRange, WeekdayRange, YearRange
from .crontab import Field, SecondsField, MinuteField, HourField, MonthdayField, MonthField, WeekdayField, YearField, DayField


from .__about__ import (
__title__,
__description__,
__url__,
__version__,
__author__,
__email__,
__license__,
)
from .__about__ import __author__, __description__, __email__, __license__, __title__, __url__, __version__
from .crontab import Crontab, DayField, Field, HourField, HourRange, MinuteField, MinuteRange, MonthdayField
from .crontab import MonthdayRange, MonthField, MonthRange, Range, SecondsField, SecondsRange, WeekdayField
from .crontab import WeekdayRange, YearField, YearRange

__all__ = [
'__title__',
Expand Down
Loading

0 comments on commit 931ce05

Please sign in to comment.