Skip to content

Commit

Permalink
Moved some stuff from setup.py and setup.cfg into pyproject.toml
Browse files Browse the repository at this point in the history
Improved stuff in setup.py a bit.
  • Loading branch information
KOLANICH committed Apr 5, 2022
1 parent 61c6ac0 commit d7ceeca
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 68 deletions.
71 changes: 71 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[build-system]
requires = ["setuptools >= 61.2.0", "wheel", "setuptools_scm[toml] >= 3.4.3"]
build-backend = "setuptools.build_meta"

[project]
name = "parglare"
authors = [{name = "Igor R. Dejanovic", email = "igorREPLACEWITHDOTdejanovic@gmail.com"}]
license = {text = "MIT"}
description = "A pure Python Scannerless LR/GLR parser"
keywords = ["parglare"]
readme = "README.rst"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Topic :: Software Development :: Interpreters",
"Topic :: Software Development :: Compilers",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Operating System :: OS Independent",
]
dependencies = ["click >=7.0, <8.0"]
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/igordejanovic/parglare"

[project.optional-dependencies]
dev = [
"wheel",
"mkdocs",
"mike",
"twine",
]
test = [
"flake8",
"coverage",
"coveralls",
"pytest",
]

[project.scripts]
pglr = "parglare.cli:pglr"

[tool.setuptools]
packages = ["parglare", "parglare.tables"]
zip-safe = false
include-package-data = true
package-dir = {parglare = "parglare"}

[tool.setuptools_scm]
write_to_template = "__version__ = \"{version}\"\n"
write_to = "parglare/version.py"

[tool.distutils.bdist_wheel]
universal = 1

[tool.flake8]
max-line-length = "90"
exclude = """
.git/*,.eggs/*,
parglare/six.py,
build/*,venv/*"""
61 changes: 0 additions & 61 deletions setup.cfg

This file was deleted.

11 changes: 4 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@
this_dir = Path(__file__).absolute().parent

if sys.argv[-1].startswith('publish'):
if os.system("pip list | grep wheel"):
if os.system("pip3 list | grep wheel"):
print("wheel not installed.\nUse `pip install wheel`.\nExiting.")
sys.exit()
if os.system("pip list | grep twine"):
if os.system("pip3 list | grep twine"):
print("twine not installed.\nUse `pip install twine`.\nExiting.")
sys.exit()
os.system("python setup.py sdist bdist_wheel")
os.system("python3 -m pep517 -bs .")
if sys.argv[-1] == 'publishtest':
os.system("twine upload -r test dist/*")
else:
os.system("twine upload dist/*")
sys.exit()

if __name__ == "__main__":
setup(use_scm_version={
"write_to": str(this_dir / "parglare" / "version.py"),
"write_to_template": '__version__ = "{version}"\n',
})
setup()

0 comments on commit d7ceeca

Please sign in to comment.