Skip to content

Commit

Permalink
Merge pull request #22 from majiidd/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
majiidd committed Mar 10, 2022
2 parents 11e6c20 + 4c3660a commit 3676a73
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 243 deletions.
54 changes: 0 additions & 54 deletions .appveyor.yml

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: ci

on: [push]

jobs:
tests:
name: ${{matrix.os}} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', pypy-3.8]
include:
- python-version: '3.6'
os: ubuntu-latest
- python-version: pypy-3.9
os: ubuntu-latest
- python-version: pypy-3.9
os: windows-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python --version

- name: Get python path
id: python-path
run: |
echo ::set-output name=path::$(python -c "import sys; print(sys.executable)")
- name: Install pipenv
run: |
python -m pip install pipenv
- name: Install dependencies
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONIOENCODING: "utf-8"
GIT_ASK_YESNO: "false"
run: |
pipenv install --dev --python=${{ steps.python-path.outputs.path }}
- name: Install extra dependency (pytest on python <= 3.7)
if: ${{ matrix.python-version == '3.6' || matrix.python-version == '3.7' }}
run: |
pipenv install --dev importlib_metadata
- name: Install extra dependency (pytest on windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
pipenv install --dev atomicwrites
- name: Run tests
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PIPENV_NOSPIN: "1"
GIT_ASK_YESNO: "false"
PYTHONIOENCODING: "utf-8"
run: |
pipenv run pytest -ra --full-trace --cov=persiantools --cov-report xml:coverage.xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: coverage.xml
verbose: true

build-and-publish:
if: github.repository == 'majiidd/persiantools' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install pypa/build
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build setuptools
python -m build --sdist --wheel --outdir dist/ .
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.10.0
rev: v2.31.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
- id: check-added-large-files
args: [ '--maxkb=256' ]
Expand All @@ -20,18 +20,18 @@ repos:
args: [ '--fix=lf' ]

- repo: https://github.com/PyCQA/isort
rev: 5.7.0
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/ambv/black
rev: 20.8b1
rev: 22.1.0
hooks:
- id: black
types_or: [ python, pyi ]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [ flake8-bugbear, flake8-implicit-str-concat ]
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

11 changes: 6 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ verify_ssl = true
name = "pypi"

[packages]
pytz = "==2021.1"
pytz = "==2021.3"

[dev-packages]
coverage = "==5.5"
pytest = "==6.2.5"
pytest-cov = "==2.12.1"
pre-commit = "==2.15.0"
coverage = "==6.2"
pytest = "==7.0.1"
pytest-cov = "==3.0.0"
pre-commit = "==2.17.0"
tomli = "==1.2.3"

[requires]
python_version = "3"

0 comments on commit 3676a73

Please sign in to comment.