-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from brandonwillard/use-github-actions
- Loading branch information
Showing
30 changed files
with
462 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: PyPI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- auto-release | ||
pull_request: | ||
branches: [master] | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: Build the sdist | ||
run: | | ||
python setup.py sdist | ||
- name: Check the sdist installs and imports | ||
run: | | ||
mkdir -p test-sdist | ||
cd test-sdist | ||
python -m venv venv-sdist | ||
venv-sdist/bin/python -m pip install ../dist/miniKanren-*.tar.gz | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist/* | ||
|
||
upload_pypi: | ||
name: Upload to PyPI on release | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
- uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_secret }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
changes: | ||
name: "Check for changes" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changes: ${{ steps.changes.outputs.src }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: dorny/paths-filter@v2 | ||
id: changes | ||
with: | ||
filters: | | ||
python: &python | ||
- 'kanren/**/*.py' | ||
- 'tests/**/*.py' | ||
- '*.py' | ||
src: | ||
- *python | ||
- '.github/**/*.yml' | ||
- 'setup.cfg' | ||
- 'requirements.txt' | ||
- '.coveragerc' | ||
- '.pre-commit-config.yaml' | ||
style: | ||
name: Check code style | ||
needs: changes | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.changes.outputs.changes == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- uses: pre-commit/action@v2.0.0 | ||
|
||
test: | ||
needs: | ||
- changes | ||
- style | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }} | ||
strategy: | ||
matrix: | ||
python-version: | ||
- 3.6 | ||
- 3.7 | ||
- 3.8 | ||
- pypy3 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Test with pytest | ||
run: | | ||
pytest -v tests/ --cov=kanren --cov-report=xml:./coverage.xml | ||
- name: Coveralls | ||
uses: AndreMiras/coveralls-python-action@develop | ||
with: | ||
parallel: true | ||
flag-name: run-${{ matrix.python-version }} | ||
|
||
all-checks: | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
name: "All tests" | ||
needs: [changes, style, test] | ||
steps: | ||
- name: Check build matrix status | ||
if: ${{ needs.changes.outputs.changes == 'true' && (needs.style.result != 'success' || needs.test.result != 'success') }} | ||
run: exit 1 | ||
|
||
upload-coverage: | ||
name: "Upload coverage" | ||
needs: [changes, all-checks] | ||
if: ${{ needs.changes.outputs.changes == 'true' && needs.all-checks.result == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: AndreMiras/coveralls-python-action@develop | ||
with: | ||
parallel-finished: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 20.8b1 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
exclude: | | ||
(?x)^( | ||
versioneer\.py| | ||
kanren/_version\.py| | ||
doc/.*| | ||
bin/.* | ||
)$ | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.8.4 | ||
hooks: | ||
- id: flake8 | ||
exclude: | | ||
(?x)^( | ||
versioneer\.py| | ||
kanren/_version\.py| | ||
doc/.*| | ||
bin/.* | ||
)$ | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.5.2 | ||
hooks: | ||
- id: isort | ||
exclude: | | ||
(?x)^( | ||
versioneer\.py| | ||
kanren/_version\.py| | ||
doc/.*| | ||
bin/.* | ||
)$ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
|
||
from kanren import Relation, conde, facts, run, var | ||
|
||
|
||
father = Relation() | ||
mother = Relation() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
# flake8: noqa | ||
"""kanren is a Python library for logic and relational programming.""" | ||
from unification import unify, reify, unifiable, var, isvar, vars, variables, Var | ||
from unification import Var, isvar, reify, unifiable, unify, var, variables, vars | ||
|
||
from .core import run, eq, conde, lall, lany | ||
from ._version import get_versions | ||
from .core import conde, eq, lall, lany, run | ||
from .facts import Relation, fact, facts | ||
from .goals import ( | ||
heado, | ||
tailo, | ||
appendo, | ||
conso, | ||
nullo, | ||
heado, | ||
itero, | ||
appendo, | ||
rembero, | ||
membero, | ||
nullo, | ||
permuteo, | ||
permuteq, | ||
membero, | ||
rembero, | ||
tailo, | ||
) | ||
from .facts import Relation, fact, facts | ||
from .term import arguments, operator, term, unifiable_with_term | ||
|
||
from ._version import get_versions | ||
|
||
__version__ = get_versions()["version"] | ||
del get_versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.