Skip to content

Commit

Permalink
Big update
Browse files Browse the repository at this point in the history
  • Loading branch information
vint21h committed May 14, 2021
1 parent 83de1dc commit 029557a
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 163 deletions.
7 changes: 1 addition & 6 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@


dotenv

if [ ! -n "$VIRTUAL_ENV" ]; then
if [ -f "Pipfile" ] ; then
pipenv shell
fi
fi
layout python
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
pull_request:
branches:
- "*"
workflow_dispatch:
env:
DEFAULT_PYTHON_VERSION: "3.9"
jobs:
Expand Down Expand Up @@ -40,7 +41,6 @@ jobs:
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install pipenv
pip install .[test]
- name: Run ${{ matrix.toxenv }}
run: tox -e ${{ matrix.toxenv }}
Expand Down Expand Up @@ -78,7 +78,6 @@ jobs:
key: .coverage-${{ github.run_id }}-${{ github.run_number }}
- name: Install dependencies
run: |
pip install pipenv
pip install .[test]
- name: Run tests
env:
Expand All @@ -100,9 +99,8 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}-${{ hashFiles('setup.py', 'setup.cfg', 'tox.ini') }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'setup.cfg', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.toxenv }}-
${{ runner.os }}-pip-
- name: Temporarily save coverage statistics
uses: actions/cache@v2
Expand All @@ -111,7 +109,6 @@ jobs:
key: .coverage-${{ github.run_id }}-${{ github.run_number }}
- name: Install dependencies
run: |
pip install pipenv
pip install .[test]
- name: Upload coverage report to Coveralls
env:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/check-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# django-po2xls
# .github/workflows/check-requirements.yml


name: check-requirements
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- "*"
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
env:
DEFAULT_PYTHON_VERSION: "3.9"
jobs:
check-requirements:
name: check-requirements
runs-on: ubuntu-latest
steps:
- name: Git clone
uses: actions/checkout@v2
- name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'setup.cfg', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install .[test]
- name: Check outdated requirements
continue-on-error: true
run: pip-outdated
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ __pycache__/*
.DS_Store
*.save
.mypy_cache/*
.pytest_cache/*


# IDE's
Expand Down Expand Up @@ -47,4 +48,4 @@ static/*
.env
.coverage
htmlcov
Pipfile.lock
.direnv
38 changes: 19 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,122 +10,122 @@ repos:
stages: [commit]
language: system
pass_filenames: false
entry: pipenv run seed-isort-config
entry: seed-isort-config
types: [python]
- id: removestar
name: removestar
stages: [commit]
language: system
entry: pipenv run removestar -i po2xls tests
entry: removestar -i po2xls tests
types: [python]
- id: isort
name: isort
stages: [commit]
language: system
entry: pipenv run isort
entry: isort
types: [python]
- id: black
name: black
stages: [commit]
language: system
entry: pipenv run black po2xls tests
entry: black po2xls tests
types: [python]
- id: yesqa
name: yesqa
stages: [commit]
language: system
pass_filenames: false
entry: pipenv run yesqa
entry: yesqa
types: [python]
- id: flake8
name: flake8
stages: [commit]
language: system
entry: pipenv run flake8
entry: flake8
types: [python]
- id: interrogate
name: interrogate
stages: [commit]
language: system
entry: pipenv run interrogate po2xls tests -I -M
entry: interrogate po2xls tests -I -M
types: [python]
- id: pylint
name: pylint
stages: [commit]
language: system
entry: pipenv run pylint po2xls tests
entry: pylint po2xls tests
types: [python]
- id: bandit
name: bandit
stages: [commit]
language: system
entry: pipenv run bandit -r po2xls tests --ini=setup.cfg
entry: bandit -r po2xls tests --ini=setup.cfg
types: [python]
pass_filenames: false
- id: dodgy
name: dodgy
stages: [commit]
language: system
entry: pipenv run dodgy
entry: dodgy
types: [python]
pass_filenames: false
- id: darglint
name: darglint
stages: [commit]
language: system
entry: pipenv run darglint
entry: darglint
types: [python]
- id: polint
name: polint
stages: [commit]
language: system
entry: pipenv run polint --ignore=location,unsorted --show-msg
entry: polint --ignore=location,unsorted --show-msg
types: [pofile]
pass_filenames: true
- id: dennis
name: dennis
stages: [commit]
language: system
entry: pipenv run dennis-cmd lint
entry: dennis-cmd lint
types: [pofile]
pass_filenames: true
- id: curlylint
name: curlylint
stages: [commit]
language: system
entry: pipenv run curlylint
entry: curlylint
types: [html,xml]
pass_filenames: true
- id: mypy
name: mypy
stages: [commit]
language: system
entry: bash -c 'PYTHONPATH="$PYTHONPATH:$PWD" pipenv run mypy'
entry: bash -c 'PYTHONPATH="$PYTHONPATH:$PWD" mypy'
types: [python]
pass_filenames: false
- id: check-manifest
name: check-manifest
stages: [commit]
language: system
pass_filenames: false
entry: pipenv run check-manifest
entry: check-manifest
- id: pyroma
name: pyroma
stages: [commit]
language: system
pass_filenames: false
entry: pipenv run pyroma -d .
entry: pyroma -d .
types: [python]
- id: check-wheel-contents
name: check-wheel-contents
stages: [commit]
language: system
pass_filenames: false
entry: bash -c 'make build -B && pipenv run check-wheel-contents dist'
entry: bash -c 'make build -B && check-wheel-contents dist'
types: [python]
- id: dotenv-linter
name: dotenv-linter
entry: pipenv run dotenv-linter
entry: dotenv-linter
language: system
stages: [commit]
types: [text]
Expand Down
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@

.ONESHELL:
PHONY: pipenv-install tox test makemessages compilemessages bumpversion build sign check check-build check-upload upload clean coveralls release help
TEST_PYPI_URL=https://test.pypi.org/legacy/
NAME=po2xls
EXTENSIONS=py,html,txt,xml
TRASH_DIRS=build dist *.egg-info .tox .mypy_cache __pycache__ htmlcov
TRASH_FILES=.coverage Pipfile.lock
BUILD_TYPES=bdist_wheel sdist
VERSION=`python -c "import configparser; config = configparser.ConfigParser(); config.read('setup.cfg'); print(config['metadata']['version']);"`
TEST_PYPI_URL ?= https://test.pypi.org/legacy/
NAME ?= po2xls
EXTENSIONS ?= py,html,txt,xml
TRASH_DIRS ?= build dist *.egg-info .tox .mypy_cache __pycache__ htmlcov
TRASH_FILES ?= .coverage Pipfile.lock
BUILD_TYPES ?= bdist_wheel sdist
VERSION ?= `python -c "import configparser; config = configparser.ConfigParser(); config.read('setup.cfg'); print(config['metadata']['version']);"`


pipenv-install:
pipenv install;\
pipenv install --dev;\
install:
pip install .[test];\


tox:
tox;\


test:
bash -c 'PYTHONPATH="$${PYTHONPATH}:$${PWD}" django-admin test $(TESTS) --settings=tests.settings';\
bash -c 'PYTHONPATH="$${PYTHONPATH}:$${PWD}" py.test --cov=$(NAME) --modules-durations=0 --functions-durations=0 --instafail $(TESTS)';\


makemessages:
Expand Down Expand Up @@ -71,7 +70,7 @@ clean:
find -iname $${file} -print0 | xargs -0 rm -rf;\
done;\
for dir in $(TRASH_DIRS); do\
find -type d -name $${dir} -print0 | xargs -0 rm -rf;\
find -type d -name $${dir} ! -path "*/.direnv/*" -print0 | xargs -0 rm -rf;\
done;\


Expand All @@ -98,8 +97,8 @@ release:
help:
@echo " help:"
@echo " Show this help."
@echo " pipenv-install:"
@echo " Install all requirements."
@echo " install:"
@echo " Install requirements."
@echo " tox:"
@echo " Run tox."
@echo " test:"
Expand Down
69 changes: 0 additions & 69 deletions Pipfile

This file was deleted.

0 comments on commit 029557a

Please sign in to comment.