From b4863493f6e70049293eafb9a47ae9da9cd24fa2 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 9 Sep 2021 19:39:06 +0300 Subject: [PATCH 1/2] Move the metadata into `setup.cfg` Add `pyproject.toml`. Use `setuptools_scm` for version getting. --- pyproject.toml | 5 +++++ setup.cfg | 46 ++++++++++++++++++++++++++++++++++++++++ setup.py | 57 -------------------------------------------------- 3 files changed, 51 insertions(+), 57 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5f713a4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg index 31ad82b..3e79bda 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,48 @@ +[metadata] +name = python-rs +author = Julian Konchunas +author_email = konchunas@gmail.com +license = MIT +description = Python to Rust transpiler. +url = http://github.com/konchunas/pyrs +long_description = + Python to Rust transpiler + + This project started as Python to Rust syntax converter. It is not + aimed at producing ready-to-compile code, but some basic stuff can be + compiled easily. + + It generates unidiomatic non-optimized code with unnecessary + allocations, but can reduce amount of edits you have to do when + porting Python projects. + + Only basic subset of Python is supported right now and the end goal is + to support common cases at least as a placeholders. + + The project is in experimental, so it may crash or silently skip some + statements, so be careful. + + Based on Lukas Martinelli Py14 + (https://github.com/lukasmartinelli/py14) and Py14/python-3 + (https://github.com/ProgVal/py14/tree/python-3) branch by Valentin + Lorentz. + +classifiers = + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python :: 3 + Topic :: Software Development + Topic :: Utilities + +[options] +packages = pyrs +python_requires = >=3.0.0 +test_suite = tests +tests_require = pytest + +[options.entry_points] +console_scripts = pyrs=pyrs.cli:main + [aliases] test = pytest + diff --git a/setup.py b/setup.py deleted file mode 100644 index ffeeb53..0000000 --- a/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -import io -import re -from setuptools import setup, find_packages - -__version__= '0.1.0' - -install_requires= [] -setup_requires= [] -tests_require = ['pytest'] - -setup( - name='python-rs', - version=__version__, - description='Python to Rust transpiler.', - long_description=""" -Python to Rust transpiler - -This project started as Python to Rust syntax converter. It is not -aimed at producing ready-to-compile code, but some basic stuff can be -compiled easily. - -It generates unidiomatic non-optimized code with unnecessary -allocations, but can reduce amount of edits you have to do when -porting Python projects. - -Only basic subset of Python is supported right now and the end goal is -to support common cases at least as a placeholders. - -The project is in experimental, so it may crash or silently skip some -statements, so be careful. - -Based on Lukas Martinelli Py14 -(https://github.com/lukasmartinelli/py14) and Py14/python-3 -(https://github.com/ProgVal/py14/tree/python-3) branch by Valentin -Lorentz. - """, - author='Julian Konchunas', - author_email='konchunas@gmail.com', - python_requires='>=3.0.0', - url='http://github.com/konchunas/pyrs', - install_requires=install_requires, - setup_requires=setup_requires, - tests_require=tests_require, - packages=find_packages(exclude=['docs', 'examples', 'tests', 'tests*']), - license='MIT', - classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Topic :: Software Development', - 'Topic :: Utilities', - ], - test_suite='tests', - entry_points = { - 'console_scripts': ['pyrs=pyrs.cli:main'], - } -) From 0df01fd0d426080d5c893cb6538c9277483de93a Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 9 Sep 2021 19:39:06 +0300 Subject: [PATCH 2/2] Moved the metadata into `PEP 621`-compliant `pyproject.toml`. --- pyproject.toml | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 48 ------------------------------------------------ 2 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 5f713a4..9112d16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,53 @@ [build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.3"] +requires = ["setuptools>=61.2.0", "wheel", "setuptools_scm[toml]>=3.4.3"] build-backend = "setuptools.build_meta" +[project] +name = "python-rs" +authors = [{name = "Julian Konchunas", email = "konchunas@gmail.com"}] +license = {text = "MIT"} +description = "Python to Rust transpiler." +classifiers = [ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Software Development", + "Topic :: Utilities", +] +urls = {Homepage = "http://github.com/konchunas/pyrs"} +requires-python = ">=3.0.0" +dynamic = ["version"] + +[project.readme] +text = """ +Python to Rust transpiler +This project started as Python to Rust syntax converter. It is not +aimed at producing ready-to-compile code, but some basic stuff can be +compiled easily. +It generates unidiomatic non-optimized code with unnecessary +allocations, but can reduce amount of edits you have to do when +porting Python projects. +Only basic subset of Python is supported right now and the end goal is +to support common cases at least as a placeholders. +The project is in experimental, so it may crash or silently skip some +statements, so be careful. +Based on Lukas Martinelli Py14 +(https://github.com/lukasmartinelli/py14) and Py14/python-3 +(https://github.com/ProgVal/py14/tree/python-3) branch by Valentin +Lorentz.""" +content-type = "text/markdown" + +[project.scripts] +pyrs = "pyrs.cli:main" + +[project.optional-dependencies] +testing = ["pytest"] + +[tool.setuptools] +packages = ["pyrs"] +include-package-data = false + [tool.setuptools_scm] + +[tool.aliases] +test = "pytest" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3e79bda..0000000 --- a/setup.cfg +++ /dev/null @@ -1,48 +0,0 @@ -[metadata] -name = python-rs -author = Julian Konchunas -author_email = konchunas@gmail.com -license = MIT -description = Python to Rust transpiler. -url = http://github.com/konchunas/pyrs -long_description = - Python to Rust transpiler - - This project started as Python to Rust syntax converter. It is not - aimed at producing ready-to-compile code, but some basic stuff can be - compiled easily. - - It generates unidiomatic non-optimized code with unnecessary - allocations, but can reduce amount of edits you have to do when - porting Python projects. - - Only basic subset of Python is supported right now and the end goal is - to support common cases at least as a placeholders. - - The project is in experimental, so it may crash or silently skip some - statements, so be careful. - - Based on Lukas Martinelli Py14 - (https://github.com/lukasmartinelli/py14) and Py14/python-3 - (https://github.com/ProgVal/py14/tree/python-3) branch by Valentin - Lorentz. - -classifiers = - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 3 - Topic :: Software Development - Topic :: Utilities - -[options] -packages = pyrs -python_requires = >=3.0.0 -test_suite = tests -tests_require = pytest - -[options.entry_points] -console_scripts = pyrs=pyrs.cli:main - -[aliases] -test = pytest -