diff --git a/.gitignore b/.gitignore index d898246..5f80504 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ tests/**/*.fst tests/**/iverilog_dump.v tests/**/.pytest_cache *~ + +cocotbext/spi/_version.py \ No newline at end of file diff --git a/cocotbext/spi/about.py b/cocotbext/spi/about.py index d3ec452..875ec06 100644 --- a/cocotbext/spi/about.py +++ b/cocotbext/spi/about.py @@ -1 +1,6 @@ -__version__ = "0.2.0" +from importlib.metadata import version, PackageNotFoundError + +try: + __version__ = version("cocotbext-spi") +except PackageNotFoundError: + pass diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4d96f42 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +[build-system] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "cocotbext-spi" +authors = [ + {name = "Spencer Chang", email = "spencer@sycee.xyz"}, +] +description = "SPI modules for cocotb" +readme = "README.md" +requires-python = ">=3.7" +license = { text = "MIT" } +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", +] +dynamic = ["version"] +dependencies = [ + "cocotb>=1.6", +] + +[project.optional-dependencies] +test = [ + "pytest", + "cocotb-test", +] + +[tool.setuptools_scm] +write_to = "cocotbext/spi/_version.py" + +[tool.pytest.ini_options] +testpaths = [ + "tests" +] +addopts = "--import-mode importlib" + +[tool.tox] +legacy_tox_ini = """ +[tox] +isolated_build = true +envlist = py37, py38, py39 + +[testenv] +deps = + pytest + pytest-xdist + cocotb-test +commnads = pytest -n auto +""" + diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index bfefdce..0000000 --- a/setup.cfg +++ /dev/null @@ -1,62 +0,0 @@ -# package information -[metadata] -name = cocotbext-spi -version = attr: cocotbext.spi.about.__version__ -description = SPI modules for cocotb -keywords = spi, cocotb -author = Spencer Chang -author_email = spencer@sycee.xyz -license = MIT -url = https://github.com/schang412/cocotbext-spi -project_urls = - Bug Tracker = https://github.com/schang412/cocotbext-spi/issues - Source Code = https://github.com/schang412/cocotbext-spi -download_url = https://github.com/schang412/cocotbext-spi/tarball/main -long_description = file: README.md -long_description_content_type = text/markdown -platforms = any -classifiers = - Development Status :: 3 - Alpha - Programming Language :: Python :: 3 - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Topic :: Scientific/Engineering :: Electronic Design Automation (EDA) - -[options] -packages = find_namespace: -python_requires = >=3.7 -install_requires = - cocotb>=1.6.0 - -[options.extras_require] -test = - pytest - cocotb-test - -[options.packages.find] -include = cocotbext.* - -# pytest configuration -[tool:pytest] -testpaths = - tests -addopts = - --import-mode importlib - -[tox:tox] -envlist = py37, py38, py39 - -[gh-actions] -python = - 3.7: py37 - 3.8: py38 - 3.9: py39 - -[testenv] -deps = - pytest - pytest-xdist - cocotb-test - -commands = - pytest -n auto diff --git a/setup.py b/setup.py deleted file mode 100644 index 8ab824c..0000000 --- a/setup.py +++ /dev/null @@ -1,2 +0,0 @@ -from setuptools import setup -setup() \ No newline at end of file