Skip to content

Commit

Permalink
Merge pull request #70 from hugovk/cclauss-patch-2
Browse files Browse the repository at this point in the history
Try GitHub Actions CI
  • Loading branch information
hugovk authored Aug 31, 2019
2 parents 65349de + 0078ac8 commit d278aa1
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 8 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox
- name: Lint
run: tox -e lint
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v1

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox
python -m pip install -e .
- name: Unit tests
shell: bash
# Drop the dot: py3.7 -> py37
run: |
tox -e py`echo ${{ matrix.python-version }} | tr -d .`
- name: Test runs
run: |
pypistats --help
pypistats recent --help
# TODO Upload to Codecov
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@ repos:
hooks:
- id: flake8
language_version: python3.7

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
language_version: python3.7

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.4.0
hooks:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![PyPI downloads](https://img.shields.io/pypi/dm/pypistats.svg)](https://pypistats.org/packages/pypistats)
[![Build Status](https://travis-ci.org/hugovk/pypistats.svg?branch=master)](https://travis-ci.org/hugovk/pypistats)
[![Build Status](https://dev.azure.com/hugovk/hugovk/_apis/build/status/hugovk.pypistats?branchName=master)](https://dev.azure.com/hugovk/hugovk/_build/latest?definitionId=1?branchName=master)
[![Actions Status](https://github.com/hugovk/pypistats/workflows/test/badge.svg)](https://github.com/hugovk/pypistats/actions)
[![codecov](https://codecov.io/gh/hugovk/pypistats/branch/master/graph/badge.svg)](https://codecov.io/gh/hugovk/pypistats)
[![GitHub](https://img.shields.io/github/license/hugovk/pypistats.svg)](LICENSE.txt)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Expand Down
2 changes: 1 addition & 1 deletion example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Example use of pypistats
"""
import argparse
from pprint import pprint # noqa
from pprint import pprint # noqa: F401

import pypistats

Expand Down
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ license_file = LICENSE.txt

[pycodestyle]
max_line_length = 88

[tool:isort]
force_grid_wrap = 0
include_trailing_comma = True
line_length = 88
multi_line_output = 3
use_parentheses = True
1 change: 1 addition & 0 deletions src/pypistats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pathlib import Path

import pkg_resources

import requests
from appdirs import user_cache_dir
from pytablewriter import (
Expand Down
3 changes: 1 addition & 2 deletions src/pypistats/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import argparse
from datetime import date, datetime

from dateutil.relativedelta import relativedelta

import pypistats
from dateutil.relativedelta import relativedelta

cli = argparse.ArgumentParser()
subparsers = cli.add_subparsers(dest="subcommand")
Expand Down
1 change: 0 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import pytest
from freezegun import freeze_time

from pypistats import cli


Expand Down
3 changes: 1 addition & 2 deletions tests/test_pypistats.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import unittest
from pathlib import Path

import requests_mock

import pypistats
import requests_mock

from .data.python_minor import DATA as PYTHON_MINOR_DATA

Expand Down
3 changes: 1 addition & 2 deletions tests/test_pypistats_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import unittest
from pathlib import Path

import pypistats
import requests_mock
from freezegun import freeze_time

import pypistats


class TestPypiStatsCache(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit d278aa1

Please sign in to comment.