Skip to content

Commit

Permalink
Merge branch 'master' into psb2_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alcides committed Mar 2, 2024
2 parents 60fce4d + 70b727c commit ae8cafc
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 92 deletions.
81 changes: 43 additions & 38 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,48 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: [ "3.10", "3.11", "3.12" ]

steps:
- uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest mypy
if [ -f requirements.pip ]; then pip install -r requirements.pip; fi
- name: Lint with mypy
run: |
mypy aeon
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check install
run: |
pip install -e .
- name: Test with pytest
run: |
pytest
- name: Run Aeon Core Files
run: |
files=$(find examples/core -type f -name '*_main.ae')
for file in $files; do
python aeon $file --core --log INFO ERROR TYPECHECKER CONSTRAINT
done
- name: Run Aeon Sugar Files
run: |
files=$(find examples/sugar -type f -name '*_main.ae')
for file in $files; do
python aeon $file --log INFO ERROR TYPECHECKER CONSTRAINT
done
- uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set env
run: echo "VIRTUAL_ENV=$(python -c 'import sys; print(sys.prefix)')">> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade uv
uv pip install flake8 pytest mypy pre-commit
if [ -f requirements.pip ]; then uv pip install -r requirements.pip; fi
#- name: Lint with pre-commit
# run: |
# pre-commit run --all-files
- name: Lint with mypy
run: |
mypy aeon --no-strict-optional --ignore-missing-imports
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 --extend-exclude .venv . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 --extend-exclude .venv . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check install
run: |
pip install -e .
- name: Test with pytest
run: |
pytest
- name: Run Aeon Core Files
run: |
files=$(find examples/core -type f -name '*_main.ae')
for file in $files; do
python aeon $file --core --log INFO ERROR TYPECHECKER CONSTRAINT
done
- name: Run Aeon Sugar Files
run: |
files=$(find examples/sugar -type f -name '*_main.ae')
for file in $files; do
python aeon $file --log INFO ERROR TYPECHECKER CONSTRAINT
done
36 changes: 19 additions & 17 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@ name: Upload Python Package

on:
release:
types: [published]
types: [ published ]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set env
run: echo "VIRTUAL_ENV=$(python -c 'import sys; print(sys.prefix)')">> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade uv
uv pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
52 changes: 29 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-docstring-first
- id: name-tests-test
- id: requirements-txt-fixer
- id: mixed-line-ending
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.0
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-docstring-first
- id: name-tests-test
- id: requirements-txt-fixer
- id: mixed-line-ending
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/hadialqattan/pycln
- id: setup-cfg-fmt
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.2
hooks:
- id: pycln
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports, --explicit-package-bases]
- repo: https://github.com/charliermarsh/ruff-pre-commit
- id: mypy
args:
[
--no-strict-optional,
--ignore-missing-imports,
--explicit-package-bases,
]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/regebro/pyroma
args: [--fix, --exit-zero]
- id: ruff-format
- repo: https://github.com/regebro/pyroma
rev: "4.2"
hooks:
- id: pyroma
- id: pyroma
26 changes: 14 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ name = "Aeon"
version = "4.0.0a"
description = "Language with Refinement Types"
authors = [
{name = "Alcides Fonseca", email = "[email protected]"}
{ name = "Alcides Fonseca", email = "[email protected]" }
]
readme = "Readme.md"
requires-python = "~=3.10"

keywords = ["programming language, liquid types"]

classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
]

[project.urls]
Expand Down Expand Up @@ -50,9 +50,8 @@ all = true
[tool.ruff]
line-length = 120

# Enable Pyflakes `E` and `F` codes by default.
select = ["E", "F"]
ignore = ["E741", "E501"]
# Assume Python 3.10.
target-version = "py310"

# Exclude a variety of commonly ignored directories.
exclude = [
Expand All @@ -76,21 +75,24 @@ exclude = [
"node_modules",
"venv",
]
per-file-ignores = {}

[tool.ruff.lint]
# Enable Pyflakes `E` and `F` codes by default.
select = ["E", "F"]
ignore = ["E741", "E501"]
per-file-ignores = { }

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.10.
target-version = "py310"

[tool.ruff.flake8-import-conventions.aliases]
[tool.ruff.lint.flake8-import-conventions.aliases]
altair = "alt"
"matplotlib.pyplot" = "plt"
numpy = "np"
pandas = "pd"
seaborn = "sns"

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
8 changes: 7 additions & 1 deletion requirements.pip
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ pytest
flake8
black
lark
psb2
zstandard==0.15.2
zss
z3-solver
toml
geneticengine @ https://github.com/alcides/GeneticEngine/archive/619d625bf1892a2161047c981ae2732dd45d0e29.zip
textdistance
loguru
numpy
argparse
configparser
multiprocess
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.10
project_urls =
Bug Tracker = http://github.com/alcides/aeon/issues

Expand Down

0 comments on commit ae8cafc

Please sign in to comment.