Modifying setup file to work with new setup structure
#!/usr/bin/env python3
-import sys
-from setuptools import setup
-from setuptools import find_packages
+from pathlib import Path
-if sys.version_info[:3] < (3, 3):
- raise SystemExit("You need Python 3.3+")
+import setuptools
-setup(
- name="scc",
- version="0.1",
- long_description_content_type='text/markdown',
- description="Silicon Compiler Collection",
- long_description=open("README.md").read(),
- author="Andreas Olofsson",
- author_email="andreas@zeroasic.com",
- url="https://zeroasic.com",
- download_url="https://github.com/zeroasiccorp/siliconcompiler",
- packages=find_packages(),
- install_requires=requirements,
- license="BSD",
- platforms=["Any"],
+project_dir = Path(__file__).parent
+
+setuptools.setup(
+ name="siliconcompiler",
+ version="0.0.0",
+ description="Silicon Compiler Collection (SCC)",
+ # Allow UTF-8 characters in README with encoding argument.
+ long_description=project_dir.joinpath("README.md").read_text(encoding="utf-8"),
keywords=["HDL", "ASIC", "FPGA", "hardware design"],
+ author="Andreas Olofsson",
+ url="https://github.com/aolofsson/siliconcompiler",
+ packages=setuptools.find_packages("src"),
+ package_dir={"": "src"},
+ # pip 9.0+ will inspect this field when installing to help users install a
+ # compatible version of the library for their Python version.
+ python_requires=">=3.6",
+ # There are some peculiarities on how to include package data for source
+ # distributions using setuptools. You also need to add entries for package
+ # data to MANIFEST.in.
+ # See https://stackoverflow.com/questions/7522250/
+ include_package_data=True,
+ # This file is required to inform mypy that inline type hints are used.
+ # See: https://mypy.readthedocs.io/en/stable/installed_packages.html
+ package_data={"siliconcompiler": ["py.typed"]},
+ # This is a trick to avoid duplicating dependencies between both setup.py and
+ # requirements.txt.
+ # requirements.txt must be included in MANIFEST.in for this to work.
+ # It does not work for all types of dependencies (e.g. VCS dependencies).
+ # For VCS dependencies, use pip >= 19 and the PEP 508 syntax.
+ # Example: 'requests @ git+https://github.com/requests/requests.git@branch_or_tag'
+ # See: https://github.com/pypa/pip/issues/6162
+ install_requires=project_dir.joinpath("requirements.txt").read_text().split("\n"),
+ zip_safe=False,
+ license="GPL",
classifiers=[
- "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
- "Environment :: Console",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
- "License :: OSI Approved :: BSD License",
- "Operating System :: OS Independent",
+ "License :: OSI Approved :: GPL License",
"Programming Language :: Python",
- "Programming Language :: Python :: 3.3",
- "Programming Language :: Python :: 3.4",
- "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
- "Programming Language :: Python :: 3.7"
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
],
+ entry_points={"console_scripts": ["scc=scc.py:main"]},
)
