diff --git a/.github/workflows/ci-build-unstable.yml b/.github/workflows/ci-build-unstable.yml index 0a230290..f9ea863a 100644 --- a/.github/workflows/ci-build-unstable.yml +++ b/.github/workflows/ci-build-unstable.yml @@ -1,8 +1,8 @@ name: Build -on: [push] +on: [ push ] -concurrency: +concurrency: group: build # cancel-in-progress: true @@ -10,24 +10,29 @@ concurrency: jobs: build: runs-on: ubuntu-latest - + strategy: + matrix: + python-version: [ 3.8, 3.9 ] steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest \ No newline at end of file + - name: Cleanup more disk space + run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest \ No newline at end of file diff --git a/classifiers.txt b/classifiers.txt new file mode 100644 index 00000000..c92b88c2 --- /dev/null +++ b/classifiers.txt @@ -0,0 +1,3 @@ +Programming Language :: Python :: 3.8 +License :: OSI Approved :: Apache Software License +Operating System :: OS Independent \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..ddaf17f3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.bumpversion] +current_version = "0.3.4" +commit = "true" +tag = "true" +tag_name = "v{new_version}" + +[project] +name = "delft" +description = "a Deep Learning Framework for Text" +readme = "Readme.md" +authors = [ + { name = "Patrice Lopez", email = "patrice.lopez@science-miner.com" } +] +maintainers = [ + { name = "Patrice Lopez", email = "patrice.lopez@science-miner.com" }, + { name = "Luca Foppiano", email = "lucanoro@duck.com" } +] +requires-python = ">=3.7" + +dynamic = ['version', "dependencies"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} +classifiers = {file = ["classifiers.txt"]} + +[project.urls] +Homepage = "https://github.com/kermitt2/delft" +Repository = "https://github.com/kermitt2/delft" +Changelog = "https://github.com/kermitt2/delft" + +[tool.setuptools.packages.find] +exclude = ["test", "*.test", "*.test.*"] \ No newline at end of file diff --git a/requirements.txt.dev b/requirements.txt.dev new file mode 100644 index 00000000..ea910fe1 --- /dev/null +++ b/requirements.txt.dev @@ -0,0 +1 @@ +bump-my-version diff --git a/setup.py b/setup.py deleted file mode 100644 index ffdfb580..00000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -from setuptools import setup, find_packages - -setup( - name="delft", - version="0.3.4", - author="Patrice Lopez", - author_email="patrice.lopez@science-miner.com", - description="a Deep Learning Framework for Text", - long_description=open("Readme.md", encoding='utf-8').read(), - long_description_content_type="text/markdown", - url="https://github.com/kermitt2/delft", - packages=find_packages(exclude=['test', '*.test', '*.test.*']), - include_package_data=True, - python_requires='>=3.7', - install_requires=[ - 'numpy==1.22.3', - 'regex==2021.11.10', - 'scikit-learn==1.0.1', - 'tqdm==4.62.3', - 'tensorflow==2.9.3', - 'h5py==3.6.0', - 'unidecode==1.3.2', - 'pydot==1.4.0', - 'lmdb==1.2.1', - 'transformers==4.33.2', - 'torch==1.10.1', - 'truecase', - 'requests>=2.20', - 'pandas==1.3.5', - 'pytest', - 'tensorflow-addons==0.19.0', - 'accelerate>=0.20.3' - ], - classifiers=[ - "Programming Language :: Python :: 3.8", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], -)