Skip to content

Commit

Permalink
Merge pull request #294 from hugovk/update-test-config
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Nov 26, 2021
2 parents 32e6691 + 9a13703 commit 06fba89
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Sync labels

on:
push:
branches:
Expand All @@ -8,7 +9,7 @@ on:
workflow_dispatch:

jobs:
build:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- main
workflow_dispatch:

jobs:
update_release_draft:
if: github.repository == 'hugovk/pypistats'
if: github.repository_owner == 'hugovk'
runs-on: ubuntu-latest
steps:
# Drafts your next release notes as pull requests are merged into "main"
Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
rev: v2.29.1
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 21.9b0
rev: 21.11b1
hooks:
- id: black
args: [--target-version=py37]

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

- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
Expand All @@ -36,10 +36,15 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.18.0
rev: v1.20.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.5.1
hooks:
- id: tox-ini-fmt

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.4.1
hooks:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ key and get free quota.)
### From PyPI

```bash
pip install --upgrade pypistats
python3 -m pip install --upgrade pypistats
```

### From source

```bash
git clone https://github.com/hugovk/pypistats
cd pypistats
pip install .
python3 -m pip install .
```

## Example command-line use
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ install_requires =
python_requires = >=3.7
package_dir = =src
setup_requires =
setuptools_scm
setuptools-scm
zip_safe = True

[options.packages.find]
Expand Down
2 changes: 1 addition & 1 deletion src/pypistats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Python 3.8+
import importlib.metadata as importlib_metadata
except ImportError:
# <Python 3.7 and lower
# Python 3.7 and lower
import importlib_metadata

__version__ = importlib_metadata.version(__name__)
Expand Down
23 changes: 13 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,38 @@
envlist =
cog
lint
py{37, 38, 39, 310}
pins
py{310, 39, 38, 37}

[testenv]
extras =
numpy
pandas
tests
commands =
# Unit tests
{envpython} -m pytest --cov pypistats --cov tests --cov-report xml {posargs}

# Test runs
pypistats --version
pypistats --help
pypistats recent --help

[testenv:cog]
deps = cogapp
commands = cog -Pr README.md
skip_install = true
deps =
cogapp
commands =
cog -Pr README.md

[testenv:lint]
deps = pre-commit
commands = pre-commit run --all-files
passenv =
PRE_COMMIT_COLOR
skip_install = true
passenv = PRE_COMMIT_COLOR
deps =
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure

[testenv:pins]
extras = None
extras =
None
commands_pre =
{envpython} -m pip install -r requirements.txt

0 comments on commit 06fba89

Please sign in to comment.