-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace setup.py with poetry (#71)
- Loading branch information
Showing
8 changed files
with
978 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
fail_fast: true | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: ruff_format | ||
name: Python format check | ||
entry: poetry run ruff format --check --diff | ||
language: system | ||
types: [file, python] | ||
stages: [pre-commit] | ||
- id: ruff_lint | ||
name: Python lint check | ||
entry: poetry run ruff check | ||
language: system | ||
types: [file, python] | ||
stages: [pre-commit] | ||
- id: pyright | ||
name: Python type check | ||
entry: poetry run pyright | ||
language: system | ||
types: [file, python] | ||
stages: [pre-commit] | ||
- id: check-yaml | ||
name: YAML check | ||
entry: poetry run check-yaml | ||
language: python | ||
types: [yaml] | ||
stages: [pre-commit] | ||
- id: check-toml | ||
name: TOML check | ||
entry: poetry run check-toml | ||
language: python | ||
types: [toml] | ||
stages: [pre-commit] | ||
- id: check-json | ||
name: JSON check | ||
entry: poetry run check-json | ||
language: python | ||
types: [json] | ||
stages: [pre-commit] | ||
- id: commitizen | ||
name: Commit style check | ||
stages: [commit-msg] | ||
entry: cz check --commit-msg-file .git/COMMIT_EDITMSG | ||
pass_filenames: false | ||
language: system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Corsair is a control and status register (CSR) map generator for HDL projects. | ||
It generates HDL code, documentation and other artifacts from CSR map description file. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
__title__ = "corsair" | ||
__description__ = "Control and status register (CSR) map generator for HDL projects." | ||
|
||
try: | ||
from ._version import version as __version__ | ||
except (ImportError, ModuleNotFoundError) as e: | ||
__version__ = 'git-latest' | ||
|
||
from . import config | ||
from .enum import EnumValue | ||
from . import config, generators | ||
from .bitfield import BitField | ||
from .enum import EnumValue | ||
from .reg import Register | ||
from .regmap import RegisterMap | ||
from . import generators | ||
from .version import __version__ | ||
|
||
__all__ = [ | ||
"__version__", | ||
"RegisterMap", | ||
"Register", | ||
"EnumValue", | ||
"BitField", | ||
"config", | ||
"generators", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Separate module to contain version and avoid circular dependencies.""" | ||
|
||
from __future__ import annotations | ||
|
||
__version__ = "0.0.0" # 0.0.0 is standard placeholder for poetry-dynamic-versioning |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[virtualenvs] | ||
in-project = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
[tool.poetry] | ||
name = "corsair" | ||
version = "0.0.0" | ||
description = "Control and Status Register map generator for FPGA/ASIC projects" | ||
authors = ["esynr3z <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
repository = "https://github.com/esynr3z/corsair" | ||
documentation = "https://corsair.readthedocs.io/" | ||
keywords = [ | ||
"CSR", | ||
"registers", | ||
"generator", | ||
"Verilog", | ||
"SystemVerilog", | ||
"Verilog", | ||
"RAL", | ||
"FPGA", | ||
"ASIC", | ||
] | ||
classifiers = [ | ||
"Environment :: Console", | ||
"Development Status :: 5 - Production/Stable", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"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 :: 3 :: Only", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", | ||
] | ||
|
||
[tool.poetry.scripts] | ||
corsair = "corsair.__main__:main" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
pyyaml = "^6.0.2" | ||
jinja2 = "^3.1.4" | ||
wavedrom = "^2.0.3.post3" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
ruff = "^0.6.9" | ||
pre-commit = "^3.5.0" | ||
commitizen = "^3.29.1" | ||
pyright = "^1.1.383" | ||
pre-commit-hooks = "^5.0.0" | ||
pytest = "^8.3.3" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] | ||
build-backend = "poetry_dynamic_versioning.backend" | ||
|
||
[tool.poetry-dynamic-versioning] | ||
enable = true | ||
vcs = "git" | ||
style = "semver" | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
extend-exclude = ["*"] # need to relax this as codebase is improved | ||
|
||
[tool.ruff.lint] | ||
select = ["ALL"] | ||
ignore = [ | ||
"D203", # incompatible with D211 | ||
"D213", # incompatible with D212 | ||
# Offical guide recommends disable these to avoid conflicts with formatter | ||
"W191", # tab-indentation | ||
"E111", # indentation-with-invalid-multiple | ||
"E114", # indentation-with-invalid-multiple-comment | ||
"E117", # over-indented | ||
"D206", # indent-with-spaces | ||
"D300", # triple-single-quotes | ||
"Q000", # bad-quotes-inline-string | ||
"Q001", # bad-quotes-multiline-string | ||
"Q002", # bad-quotes-docstring | ||
"Q003", # avoidable-escaped-quote | ||
"COM812", # missing-trailing-comma | ||
"COM819", # prohibited-trailing-comma | ||
"ISC001", # single-line-implicit-string-concatenation | ||
"ISC002", # multi-line-implicit-string-concatenation | ||
] | ||
|
||
[tool.ruff.lint.isort] | ||
required-imports = ["from __future__ import annotations"] | ||
|
||
[tool.ruff.format] | ||
docstring-code-format = true | ||
|
||
[tool.pyright] | ||
exclude = ["*"] # need to relax this as codebase is improved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
poetry==1.8.3 | ||
poetry-dynamic-versioning[plugin]==1.4.1 |