Skip to content

Commit

Permalink
maint: general structure (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie authored Dec 4, 2024
1 parent d6b48b2 commit 012b7a3
Show file tree
Hide file tree
Showing 15 changed files with 543 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = venv, __init__.py, doc/_build, .venv
exclude = venv, __init__.py, doc/_build, .venv, tests/customized_functions/*
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E301, E303, E501, F401, F403
count = True
max-complexity = 10
Expand Down
76 changes: 76 additions & 0 deletions _package/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
fail_fast: True

ci:
# Commit name when auto fixing PRs.
autofix_commit_msg: |
ci: auto fixes from pre-commit.com hooks.
for more information, see https://pre-commit.ci
# PR name when autoupdate
autoupdate_commit_msg: 'ci: pre-commit autoupdate'


repos:

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/numpy/numpydoc
rev: v1.8.0
hooks:
- id: numpydoc-validation
exclude: |
(?x)(
tests/|
examples|
doc/source/|
src/ansys/mapdl/core/_commands|
src/ansys/mapdl/core/commands
)
- repo: https://github.com/psf/black
rev: 24.10.0 # If version changes --> modify "blacken-docs" manually as well.
hooks:
- id: black
args:
- --line-length=88

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.19.0
hooks:
- id: blacken-docs
additional_dependencies: [black==24.10.0]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ["--toml", "pyproject.toml"]
additional_dependencies: ["tomli"]

# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# additional_dependencies: [toml]
# exclude: "tests/"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: debug-statements

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows
25 changes: 24 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ library_name_structured: # Future name of the library
- pyconverter
- generatedcommands

subfolder:
- subfolder
- subsubfolder

new_package_name: package

rules:
Expand All @@ -11,6 +15,25 @@ rules:
specific_command_mapping:
"*DEL": stardel
"C***": c
"/INQUIRE": inquire

ignored_commands:
- "*VWR"
- "*MWR"
- "C***"
- "*CFO"
- "*CRE"
- "*END"
- "/EOF"
- "*ASK"
- "*IF"
- "*ELSE"
- "CMAT"
- "*REP"
- "*RETURN"
- "LSRE"


specific_classes:
2D to 3D Analysis: Analysis 2D to 3D
2D to 3D Analysis: Analysis 2D to 3D
Parameters: Parameter definition
16 changes: 8 additions & 8 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
author = "ANSYS, Inc."
release = version = __version__
cname = os.getenv("DOCUMENTATION_CNAME", "<DEFAULT_CNAME>")
cname = os.getenv("DOCUMENTATION_CNAME", "pyconverter-xml2py.docs.pyansys.com")
switcher_version = get_version_match(__version__)

REPOSITORY_NAME = "pyconverter-xml2py"
Expand Down Expand Up @@ -38,7 +38,7 @@
"icon_links": [
{
"name": "Support",
"url": "https://github.com/ansys/pyconverter-xml2py/discussions",
"url": f"https://github.com/{USERNAME}/{REPOSITORY_NAME}/discussions",
"icon": "fa fa-comment fa-fw",
},
],
Expand All @@ -54,9 +54,9 @@

html_context = {
"display_github": True, # Integrate GitHub
"github_user": "ansys",
"github_user": USERNAME,
"github_repo": REPOSITORY_NAME,
"github_version": "main",
"github_version": BRANCH,
"doc_path": "doc/source",
}

Expand All @@ -65,13 +65,13 @@
"ansys_sphinx_theme.extension.autoapi",
"jupyter_sphinx",
"numpydoc",
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx.ext.graphviz",
"sphinx_copybutton",
"sphinx_design",
"sphinx.ext.autodoc",
"sphinx.ext.extlinks",
"sphinx.ext.graphviz",
"sphinx.ext.intersphinx",
]

# Intersphinx mapping
Expand Down
Loading

0 comments on commit 012b7a3

Please sign in to comment.