Update installations and workflows

* Update pyproject.toml
* Create a Workflow file to test formatting in PR
This commit is contained in:
Dario Coscia
2025-02-24 11:14:07 +01:00
committed by Nicola Demo
parent ed0a8bd5e7
commit 4c4482b155
3 changed files with 48 additions and 10 deletions

View File

@@ -0,0 +1,19 @@
name: Black Formatter (PR Check)
on:
pull_request:
branches:
- "**" # Run on pull requests for all branches
jobs:
linter:
name: runner / black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Black formatter (check mode)
uses: psf/black@stable
with:
options: "--check -l 80"
src: "./pina"

View File

@@ -27,4 +27,4 @@ jobs:
There appear to be some python formatting errors in ${{ github.sha }}. This pull request There appear to be some python formatting errors in ${{ github.sha }}. This pull request
uses the [psf/black](https://github.com/psf/black) formatter to fix these issues. uses the [psf/black](https://github.com/psf/black) formatter to fix these issues.
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
branch: actions/black branch: actions/black

View File

@@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project] [project]
name = "pina-mathlab" name = "pina-mathlab"
version = "0.2.0" version = "0.2.0"
@@ -18,21 +14,44 @@ keywords = [
"neural-operators", "equation-learning", "lightining" "neural-operators", "equation-learning", "lightining"
] ]
dependencies = [ dependencies = [
"torch", "lightning", "torch_geometric", "matplotlib", "torch",
"lightning",
"torch_geometric",
"matplotlib",
] ]
requires-python = ">=3.8" requires-python = ">=3.8"
[project.optional-dependencies] [project.optional-dependencies]
docs = [ docs = [
"sphinx>5.0", "sphinx_rtd_theme", "sphinx_copybutton", "sphinx_design", "pydata_sphinx_theme" "sphinx>5.0",
"sphinx_rtd_theme",
"sphinx_copybutton",
"sphinx_design",
"pydata_sphinx_theme"
] ]
test = [ test = [
"pytest", "pytest-cov", "scipy" "pytest",
"pytest-cov",
"scipy"
] ]
[project.urls] [project.urls]
Homepage = "https://mathlab.github.io/PINA/" Homepage = "https://mathlab.github.io/PINA/"
Repository = "https://github.com/mathLab/PINA" Repository = "https://github.com/mathLab/PINA"
[tool.setuptools.packages] [build-system]
find = {} requires = [ "setuptools>=41", "wheel", "setuptools-git-versioning>=2.0,<3", ]
build-backend = "setuptools.build_meta"
[tool.setuptools-git-versioning]
enabled = true
template = "{tag}"
[tool.setuptools.packages.find]
include = ["pina*"]
[tool.black]
line-length = 80
[tool.isort]
profile = "black"