From 06f64357800ca4cd55fae4673eed368945614f37 Mon Sep 17 00:00:00 2001 From: AlArgente Date: Thu, 14 Mar 2024 08:17:54 +0100 Subject: [PATCH 1/2] Add flexible-fl as package dependency --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4135f22..1e5f479 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( name="flexnlp", - version="0.0.1", + version="0.1.0", author="Cristina Zuheros-Montes and Argente-Garrido Alberto", long_description=open("README.md", "r", encoding="utf-8").read(), long_description_content_type="text/markdown", @@ -41,7 +41,7 @@ "tqdm", "scipy", "gdown", - # "flexible", + "flexible-fl", "torch", "torchtext", "portalocker", From d45e844fb34c5a89a8db2d88441e35730ed1d884 Mon Sep 17 00:00:00 2001 From: AlArgente Date: Thu, 14 Mar 2024 08:27:30 +0100 Subject: [PATCH 2/2] Added trunk and applied it. --- .trunk/.gitignore | 9 ++++ .trunk/configs/.isort.cfg | 2 + .trunk/configs/.markdownlint.yaml | 10 ++++ .trunk/configs/.yamllint.yaml | 7 +++ .trunk/configs/ruff.toml | 5 ++ .trunk/trunk.yaml | 37 +++++++++++++ setup.py | 89 ++++++++++++++++--------------- 7 files changed, 116 insertions(+), 43 deletions(-) create mode 100644 .trunk/.gitignore create mode 100644 .trunk/configs/.isort.cfg create mode 100644 .trunk/configs/.markdownlint.yaml create mode 100644 .trunk/configs/.yamllint.yaml create mode 100644 .trunk/configs/ruff.toml create mode 100644 .trunk/trunk.yaml diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 0000000..15966d0 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,9 @@ +*out +*logs +*actions +*notifications +*tools +plugins +user_trunk.yaml +user.yaml +tmp diff --git a/.trunk/configs/.isort.cfg b/.trunk/configs/.isort.cfg new file mode 100644 index 0000000..b9fb3f3 --- /dev/null +++ b/.trunk/configs/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +profile=black diff --git a/.trunk/configs/.markdownlint.yaml b/.trunk/configs/.markdownlint.yaml new file mode 100644 index 0000000..fb94039 --- /dev/null +++ b/.trunk/configs/.markdownlint.yaml @@ -0,0 +1,10 @@ +# Autoformatter friendly markdownlint config (all formatting rules disabled) +default: true +blank_lines: false +bullet: false +html: false +indentation: false +line_length: false +spaces: false +url: false +whitespace: false diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml new file mode 100644 index 0000000..184e251 --- /dev/null +++ b/.trunk/configs/.yamllint.yaml @@ -0,0 +1,7 @@ +rules: + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/.trunk/configs/ruff.toml b/.trunk/configs/ruff.toml new file mode 100644 index 0000000..f5a235c --- /dev/null +++ b/.trunk/configs/ruff.toml @@ -0,0 +1,5 @@ +# Generic, formatter-friendly config. +select = ["B", "D3", "E", "F"] + +# Never enforce `E501` (line length violations). This should be handled by formatters. +ignore = ["E501"] diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 0000000..e21f7fe --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,37 @@ +# This file controls the behavior of Trunk: https://docs.trunk.io/cli +# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml +version: 0.1 +cli: + version: 1.21.0 +# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) +plugins: + sources: + - id: trunk + ref: v1.4.4 + uri: https://github.com/trunk-io/plugins +# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) +runtimes: + enabled: + - node@18.12.1 + - python@3.10.8 +# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) +lint: + enabled: + - actionlint@1.6.27 + - bandit@1.7.8 + - black@24.2.0 + - checkov@3.2.36 + - git-diff-check + - isort@5.13.2 + - markdownlint@0.39.0 + - prettier@3.2.5 + - ruff@0.3.2 + - trivy@0.49.1 + - trufflehog@3.69.0 + - yamllint@1.35.1 +actions: + enabled: + - trunk-announce + - trunk-check-pre-push + - trunk-fmt-pre-commit + - trunk-upgrade-available diff --git a/setup.py b/setup.py index 1e5f479..82b24e0 100644 --- a/setup.py +++ b/setup.py @@ -14,51 +14,54 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . """ -from setuptools import find_packages, setup +from setuptools import find_packages, setup -PT_requires = ["torch", - "torchvision", - "torchtext", - "torchdata", - "portalocker", - ] +PT_requires = [ + "torch", + "torchvision", + "torchtext", + "torchdata", + "portalocker", +] setup( - name="flexnlp", - version="0.1.0", - author="Cristina Zuheros-Montes and Argente-Garrido Alberto", - long_description=open("README.md", "r", encoding="utf-8").read(), - long_description_content_type="text/markdown", - keywords="FL federated-learning flexible NLP", - url="https://github.com/FLEXible-FL/flex-nlp", - packages=find_packages(), - install_requires=["numpy", - "multiprocess", - "scikit-learn", - "cardinality", - "sultan", - "tqdm", - "scipy", - "gdown", - "flexible-fl", - "torch", - "torchtext", - "portalocker", - "torchdata", - "datasets", - "transformers", - "sentence_transformers", - "sentencepiece", - ], - extras_require={ - "pytorch": PT_requires, - "develop": ["pytest", - "pytest-cov", - "pytest-xdist", - "coverage", - "jinja2", - ], - }, - python_requires=">=3.8.10", + name="flexnlp", + version="0.1.0", + author="Cristina Zuheros-Montes and Argente-Garrido Alberto", + long_description=open("README.md", "r", encoding="utf-8").read(), + long_description_content_type="text/markdown", + keywords="FL federated-learning flexible NLP", + url="https://github.com/FLEXible-FL/flex-nlp", + packages=find_packages(), + install_requires=[ + "numpy", + "multiprocess", + "scikit-learn", + "cardinality", + "sultan", + "tqdm", + "scipy", + "gdown", + "flexible-fl", + "torch", + "torchtext", + "portalocker", + "torchdata", + "datasets", + "transformers", + "sentence_transformers", + "sentencepiece", + ], + extras_require={ + "pytorch": PT_requires, + "develop": [ + "pytest", + "pytest-cov", + "pytest-xdist", + "coverage", + "jinja2", + ], + }, + python_requires=">=3.8.10", )