Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pipfile #1

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: '${{ matrix.os }}'
strategy:
matrix:
include:
- os: ubuntu-latest
python-version: '3.8'
FALCON: 3.1.1
- os: ubuntu-latest
python-version: '3.8'
FALCON: 3.0.1
- os: ubuntu-latest
python-version: '3.9'
FALCON: 3.1.1
- os: ubuntu-latest
python-version: '3.9'
FALCON: 3.0.1
- os: ubuntu-latest
python-version: '3.10'
FALCON: 3.1.1
- os: ubuntu-latest
python-version: '3.10'
FALCON: 3.0.1
- os: ubuntu-latest
python-version: '3.11'
FALCON: 3.1.1
- os: ubuntu-latest
python-version: '3.11'
FALCON: 3.0.1
steps:
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python-version }}'
- uses: actions/checkout@v2
- run: pip install FALCON==$FALCON
env:
FALCON: '${{ matrix.FALCON }}'
- run: pip install pytest-cov codecov
- run: pip install -r requirements-dev.txt .
- run: pip install .
- run: pytest --cov=./falcon_casbin
- run: codecov
39 changes: 20 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-yaml
- id: mixed-line-ending
args: ['--fix=lf']
description: Forces to replace line ending by the UNIX 'lf' character.
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys', '--no-ensure-ascii']
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
language_version: python3
args: [-t, py310]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
description: Forces to replace line ending by the UNIX 'lf' character.
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/d-ryzhykau/pipenv-lock-pre-commit
rev: 0.5.0
hooks:
- id: pipenv-lock
- id: pipenv-verify
- id: pipenv-requirements
- id: pipenv-requirements-dev
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

47 changes: 15 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
.PHONY: help build clean update test lint

VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
PYTHON=${VENV_NAME}/bin/python3
.PHONY: help dev test lint pre-commit

.DEFAULT: help
help:
@echo "make build"
@echo " prepare development environment, use only once"
@echo "make clean"
@echo " delete development environment"
@echo "make update"
@echo " update dependencies"
@echo "make dev"
@echo " prepare development environment"
@echo "make test"
@echo " run tests"
@echo " run tests"
@echo "make lint"
@echo " run black"

build:
make venv

venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate:
test -d $(VENV_NAME) || virtualenv -p python3 $(VENV_NAME)
${PYTHON} -m pip install -U pip
${PYTHON} -m pip install -r dev_requirements.txt
$(VENV_NAME)/bin/pre-commit install
touch $(VENV_NAME)/bin/activate
@echo " run black"
@echo "make pre-commit"
@echo " run pre-commit hooks"

clean:
rm -rf venv
dev:
pipenv install --dev

update:
${PYTHON} -m pip install -r dev_requirements.txt
test:
pipenv run pytest

test: venv
${PYTHON} -m pytest
lint:
pipenv run black .

lint: venv
$(VENV_NAME)/bin/black -t py310 --exclude $(VENV_NAME) .
pre-commit:
pipenv run pre-commit
13 changes: 13 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
falcon = "==3.0.0"

[dev-packages]
black = "==23.9.1"
pre-commit = "==3.4.0"
pretend = "==1.0.9"
pytest = "==7.4.2"
Loading
Loading