Skip to content

Commit

Permalink
feat: initial commit 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
bdura committed Mar 29, 2024
0 parents commit cdd4d07
Show file tree
Hide file tree
Showing 8 changed files with 1,267 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests and Linting

on:
workflow_dispatch:
pull_request:
push:
branches: [main]

jobs:
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
env:
SKIP: no-commit-to-branch

Test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry & dependencies
run: |
pip install poetry==1.8.2
poetry install
- name: Test with Pytest on Python
run: poetry run pytest
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# OS
.DS_Store

# IDE
.vscode
.idea

# Python
__pycache__
.venv

# Coverage
.coverage
coverage.xml

# Notebooks
*.ipynb
.ipynb_checkpoints

# Secrets
.env

# Data
data/
*.db
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: no-commit-to-branch
- id: end-of-file-fixer
- id: check-yaml
args: ["--unsafe"]
- id: check-toml
- id: check-json
- id: check-symlinks
- id: check-docstring-first
- id: check-added-large-files
- id: detect-private-key
- id: pretty-format-json
args:
- "--autofix"
- "--no-sort-keys"

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.2
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.9.0"
hooks:
- id: mypy
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Persil: a typed "fork" of parsy
Empty file added persil/__init__.py
Empty file.
1,137 changes: 1,137 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[tool.poetry]
name = "persil"
version = "0.1.0"
description = ""
authors = ["Basile Dura <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"


[tool.poetry.group.dev.dependencies]
ipykernel = "^6.29.4"
ruff = "^0.3.4"
pre-commit = "^3.7.0"
mypy = "^1.9.0"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]

[tool.pytest.ini_options]
addopts = "--cov persil --cov-report term --cov-report xml"
testpaths = ["tests"]
2 changes: 2 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_dummy():
pass

0 comments on commit cdd4d07

Please sign in to comment.