diff --git a/INSTALL b/INSTALL deleted file mode 100644 index b1cfc54..0000000 --- a/INSTALL +++ /dev/null @@ -1,15 +0,0 @@ -Installation instructions for asteval -======================================== - -To install the asteval module, use:: - python setup.py install - -or - pip install asteval - -Asteval require Python 3.5 or higher. -If installed, many functions and constants from numpy -will be used by default. - -Matt Newville -Last Update: 14-Nov-2019 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index d3e3875..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,10 +0,0 @@ -include README.txt INSTALL LICENSE MANIFEST.in PKG-INFO -include setup.py publish_docs.sh -exclude *.pyc core.* *~ *.pdf -recursive-include lib *.py -recursive-include tests *.py -recursive-include doc * -recursive-exclude doc/_build * -recursive-exclude doc *.pdf -include versioneer.py -include asteval/_version.py diff --git a/README.rst b/README.rst index 91176d5..8ba775e 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,6 @@ ASTEVAL :target: https://zenodo.org/badge/latestdoi/4185/newville/asteval - Links ----- @@ -38,8 +37,20 @@ Links * Development Code: https://github.com/lmfit/asteval * Issue Tracker: https://github.com/lmfit/asteval/issues -What is it? ------------ +Installation +---------- + +To install the asteval module, use:: + pip install asteval + +or download and unack the source package and use + pip install . + +Asteval require Python 3.8 or higher. If installed, many functions and +constants from numpy will be used by default. + +About ASTEVAL +-------------- ASTEVAL is a safe(ish) evaluator of Python expressions and statements, using Python's ast module. The idea is to provide a simple, safe, and @@ -67,9 +78,13 @@ the most important differences and absences are: 1. Variable and function symbol names are held in a simple symbol table (a single dictionary), giving a flat namespace. 2. creating classes is not supported. - 3. importing modules is not supported. + 3. importing modules is not supported by default - it can be enabled. 4. function decorators, yield, lambda, exec, and eval are not supported. 5. files can only be opened in read-only mode. In addition, accessing many internal methods and classes of objects is forbidden in order to strengthen asteval against malicious user code. + + +Matt Newville +Last Update: 30-June-2024 diff --git a/pyproject.toml b/pyproject.toml index 4c3ce84..782e298 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,47 @@ build-backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "asteval/version.py" version_scheme = "post-release" + +[tool.setuptools.packages.find] +include = ["asteval"] + +[tool.coverage.run] +omit = ["tests/*"] + +[tool.pytest.ini_options] +addopts = "--cov=asteval --cov-report html" + +[project] +name = "asteval" +dynamic = ["version"] +requires-python = ">= 3.8" +description = "Safe, minimalistic evaluator of python expression using ast module" +readme = "README.rst" +authors = [ + {name = "Matthew Newville", email = "matt.newville@gmail.com"} +] +license = {file = "LICENSE"} +keywords = ["AST", "expression evaluation", "eval"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: PyPy", + ] + +[project.url] +Homepage = " https://github.com/lmfit/asteval" +Documentation = "https://lmfit.github.io/asteval/" +Tracker = "https://github.com/lmfit/asteval/issues" + +[project.optional-dependencies] +dev = ["build", "twine"] +doc = ["Sphinx"] +test = ["pytest", "pytest-cov", "coverage"] +all = ["asteval[dev, doc, test]"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 98faef5..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -## -## pip requirements file. To install dependencies, use -## -## pip install -r requirements.txt -importlib_metadata ; python_version < '3.8' diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index da50787..0000000 --- a/setup.cfg +++ /dev/null @@ -1,71 +0,0 @@ -[metadata] -name = asteval -description = Safe, minimalistic evaluator of python expression using ast module -long_description = - ASTEVAL provides a numpy-aware, safe(ish) 'eval' function - Emphasis is on mathematical expressions, and so numpy ufuncs - are used if available. Symbols are held in the Interpreter - symbol table 'symtable': a simple dictionary supporting a - simple, flat namespace. - Expressions can be compiled into ast node for later evaluation, - using the values in the symbol table current at evaluation time. - -author = Matthew Newville -author_email = matt.newville@gmail.com -url = https://github.com/lmfit/asteval -license = MIT License -platforms = any - -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: Implementation :: PyPy - -project_urls = - Source = https://github.com/lmfit/asteval - Documentation = https://lmfit.github.io/asteval/ - Tracker = https://github.com/lmfit/asteval/issues - - -[options] -packages = find: -include_package_data = True -python_requires = >=3.8 -setup_requires = setuptools_scm -test_requires = pytest - -[options.packages.find] -include = - asteval - -[options.extras_require] -dev = - build - twine - -doc = - Sphinx - -test = - coverage - pytest - pytest-cov - -all = - %(dev)s - %(test)s - %(doc)s - - -[coverage:run] -omit = tests/* - -[tool:pytest] -addopts = --cov=asteval --cov-report xml