提交 350f4823 authored 作者: Maxim Kochurov's avatar Maxim Kochurov 提交者: Maxim Kochurov

refresh github actions and use pyproject.toml

上级 5f560e15
......@@ -9,10 +9,10 @@ jobs:
if: github.repository == 'pymc-devs/pytensor'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
......
......@@ -17,28 +17,47 @@ concurrency:
cancel-in-progress: true
jobs:
# The job to build pypi wheels users can installed precompiled for them.
# At the moment only linux wheels are build, Windows and MacOS will compile on installation
# Before prebuilds all users had to compile code anyway.
build:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v3
with:
python-version: "3.8"
python-version: ${{ matrix.python-version }}
- name: Build the sdist and the wheel
run: |
pip install wheel
python setup.py sdist bdist_wheel
pip install build
python -m build
- 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/pytensor-*.tar.gz
# check import
venv-sdist/bin/python -c "import pytensor;print(pytensor.__version__)"
- uses: actions/upload-artifact@v2
# check import cython module
venv-sdist/bin/python -c 'from pytensor.scan import scan_perform; print(scan_perform.get_version())'
- name: Check the bdist installs and imports
run: |
mkdir -p test-bdist
cd test-bdist
python -m venv venv-bdist
venv-bdist/bin/python -m pip install ../dist/pytensor-*.whl
# check import
venv-bdist/bin/python -c "import pytensor;print(pytensor.__version__)"
# check import cython module
venv-bdist/bin/python -c 'from pytensor.scan import scan_perform; print(scan_perform.get_version())'
- uses: actions/upload-artifact@v3
with:
name: artifact
path: dist/*
......@@ -49,7 +68,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
......
......@@ -23,7 +23,7 @@ jobs:
outputs:
changes: ${{ steps.changes.outputs.src }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
......@@ -52,7 +52,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.9'
......@@ -90,7 +90,7 @@ jobs:
install-numba: 1
part: "tests --ignore=tests/tensor/nnet --ignore=tests/tensor/signal"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
......@@ -110,7 +110,7 @@ jobs:
echo $MATRIX_CONTEXT
export MATRIX_ID=`echo $MATRIX_CONTEXT | md5sum | cut -c 1-32`
echo $MATRIX_ID
echo "::set-output name=id::$MATRIX_ID"
echo "id=$MATRIX_ID" >> $GITHUB_OUTPUT
- name: Install dependencies
shell: bash -l {0}
......@@ -143,7 +143,7 @@ jobs:
FLOAT32: ${{ matrix.float32 }}
- name: Upload coverage file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage/coverage-${{ steps.matrix-id.outputs.id }}.xml
......@@ -164,7 +164,7 @@ jobs:
needs: [changes, all-checks]
if: ${{ needs.changes.outputs.changes == 'true' && needs.all-checks.result == 'success' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
......
[build-system]
requires = [
"setuptools>=48.0.0",
"cython",
"numpy>=1.17.0",
"versioneer[toml]==0.28",
]
build-backend = "setuptools.build_meta"
[project]
name = "pytensor"
dynamic = [
'version'
]
requires-python = ">=3.7"
authors = [
{name = "pymc-devs", email = "pymc.devs@gmail.com"}
]
description = "Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs."
readme = "DESCRIPTION.txt"
license = {file = "LICENCE.txt"}
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Compilers",
"Topic :: Scientific/Engineering :: Mathematics",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
keywords = [
"pytensor",
"math",
"numerical",
"symbolic",
"blas",
"numpy",
"autodiff",
"differentiation",
]
dependencies = [
"setuptools>=48.0.0",
"scipy>=0.14",
"numpy>=1.17.0",
"filelock",
"etuples",
"logical-unification",
"miniKanren",
"cons",
"typing_extensions",
]
[project.urls]
homepage = "https://github.com/pymc-devs/pytensor"
repository = "https://github.com/pymc-devs/pytensor"
documentation = "https://pytensor.readthedocs.io/en/latest/"
[project.scripts]
pytensor-cache = "bin.pytensor_cache:main"
[project.optional-dependencies]
complete = [
"pytensor[jax]",
"pytensor[numba]",
]
development = [
"pytensor[complete]",
"pytensor[tests]",
"pytensor[rtd]"
]
tests = [
"pytest",
"pre-commit",
"pytest-cov>=2.6.1",
"coverage>=5.1",
]
rtd = [
"sphinx>=1.3.0",
"sphinx_rtd_theme",
"pygments",
"pydot",
"pydot2",
"pydot-ng",
]
jax = [
"jax",
"jaxlib",
]
numba = [
"numba>=0.55",
"numba-scipy>=0.3.0"
]
[tool.setuptools.packages.find]
exclude = [
"tests",
"tests.*"
]
[tool.setuptools.package-data]
"*" = [
"*.txt",
"*.rst",
"*.cu",
"*.cuh",
"*.c",
"*.sh",
"*.pkl",
"*.h",
"*.cpp",
"ChangeLog",
"c_code/*",
]
pytensor = [
"py.typed"
]
"pytensor.misc" = [
"*.sh"
]
"pytensor.d3viz" = [
"html/*",
"css/*",
"js/*",
]
[tool.coverage.run]
omit = [
"pytensor/_version.py",
"tests/*",
"pytensor/assert_op.py",
"pytensor/graph/opt.py",
"pytensor/graph/opt_utils.py",
"pytensor/graph/optdb.py",
"pytensor/graph/kanren.py",
"pytensor/graph/unify.py",
"pytensor/link/jax/jax_linker.py",
"pytensor/link/jax/jax_dispatch.py",
"pytensor/graph/toolbox.py",
"pytensor/scalar/basic_scipy.py",
]
branch = true
relative_files = true
[tool.coverage.report]
omit = [
"pytensor/_version.py",
"tests/",
]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
]
show_missing = true
[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "pytensor/_version.py"
versionfile_build = "pytensor/_version.py"
tag_prefix = "rel-"
[tool.pytest]
addopts = "--durations=50"
testpaths = "tests/"
[tool.pylint]
max-line-length = 88
[tool.pylint.messages_control]
disable = ["C0330", "C0326"]
[tool.isort]
profile = "black"
lines_after_imports = 2
lines_between_sections = 1
honor_noqa = true
skip_gitignore = true
skip = "pytensor/version.py"
skip_glob = "**/*.pyx"
[tool.mypy]
ignore_missing_imports = true
no_implicit_optional = true
check_untyped_defs = false
strict_equality = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
warn_return_any = true
warn_no_return = false
warn_unreachable = true
show_error_codes = true
allow_redefinition = false
files = ["pytensor", "tests"]
plugins = ["numpy.typing.mypy_plugin"]
-e ./
sphinx>=1.3.0
sphinx_rtd_theme
pygments
pytest
numpy
gnumpy
pydot
pydot2
pydot-ng
Cython
scipy>=0.13
[metadata]
name = pytensor
author = pymc-devs
author_email = pymc.devs@gmail.com
description = Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs.
long_description = file: DESCRIPTION.txt
long_description_content_type = text/x-rst
url = https://github.com/pymc-devs/pytensor
license = BSD
platforms =
Windows
Linux
Solaris
Mac OS-X
Unix
classifiers =
Development Status :: 6 - Mature
Intended Audience :: Education
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Programming Language :: Python
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Compilers
Topic :: Scientific/Engineering :: Mathematics
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
keywords =
pytensor
math
numerical
symbolic
blas
numpy
autodiff
differentiation
[options]
packages = find:
python_requires = >=3.7
install_requires =
numpy >=1.17.0
scipy >=0.14
filelock
etuples
logical-unification
miniKanren
cons
typing_extensions
setuptools >=48.0.0
[options.packages.find]
exclude =
tests
tests.*
[options.entry_points]
console_scripts =
pytensor-cache = bin.pytensor_cache:main
[options.package_data]
* =
*.txt
*.rst
*.cu
*.cuh
*.c
*.sh
*.pkl
*.h
*.cpp
ChangeLog
c_code/*
pytensor =
py.typed
pytensor.misc =
*.sh
pytensor.d3viz =
html/*
css/*
js/*
[flake8]
select = C,E,F,W
ignore = E203,E231,E501,E741,W503,W504,C901
......@@ -107,74 +19,5 @@ per-file-ignores =
tests/scalar/test_basic_sympy.py:E402
pytensor/graph/rewriting/unify.py:F811
exclude =
versioneer.py
doc/
pytensor/_version.py
[coverage:run]
omit =
pytensor/_version.py
tests/*
pytensor/assert_op.py
pytensor/graph/opt.py
pytensor/graph/opt_utils.py
pytensor/graph/optdb.py
pytensor/graph/kanren.py
pytensor/graph/unify.py
pytensor/link/jax/jax_linker.py
pytensor/link/jax/jax_dispatch.py
pytensor/graph/toolbox.py
pytensor/scalar/basic_scipy.py
branch = True
relative_files = true
[coverage:report]
omit =
pytensor/_version.py
tests/*
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
show_missing = 1
[versioneer]
VCS = git
style = pep440
versionfile_source = pytensor/_version.py
versionfile_build = pytensor/_version.py
tag_prefix = rel-
[tool:pytest]
addopts = --durations=50
testpaths = tests/
[pylint]
max-line-length = 88
[pylint.messages_control]
disable = C0330, C0326
[isort]
profile = black
lines_after_imports = 2
lines_between_sections = 1
honor_noqa = True
skip_gitignore = True
skip = pytensor/version.py
skip_glob = **/*.pyx
[mypy]
ignore_missing_imports = True
no_implicit_optional = True
check_untyped_defs = False
strict_equality = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unused_ignores = True
warn_return_any = True
warn_no_return = False
warn_unreachable = True
show_error_codes = True
allow_redefinition = False
files = pytensor,tests
plugins = numpy.typing.mypy_plugin
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论