From ec2f45361e262a75dfac192d8943b9d32aa1a2b6 Mon Sep 17 00:00:00 2001 From: alexmindset Date: Thu, 28 Jul 2022 00:28:58 +0300 Subject: [PATCH 1/3] Maintenance: Versioning with setuptools_scm, not fixed VERSION file. --- VERSION | 1 - docs/conf.py | 21 +++------------------ pyproject.toml | 3 +++ setup.py | 8 +------- 4 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 VERSION diff --git a/VERSION b/VERSION deleted file mode 100644 index 6ae60cb9..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.4.19 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 51d9fc3a..5dcccd30 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,33 +1,18 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# import os import sys from datetime import datetime +from importlib.metadata import version sys.path.insert(0, os.path.abspath('../insolver/')) - # -- Project information ----------------------------------------------------- project = 'Insolver' copyright = f'2020-{datetime.now().year}, MindSet Team' author = 'MindSet Team' -# The full version, including alpha/beta/rc tags -with open('../VERSION', "r", encoding="utf-8") as v: - v = v.read() - -release = version = v +release = version('insolver') +version = '.'.join(release.split('.')[:3]) # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index bab8b8df..4c987271 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,12 @@ [build-system] requires = [ "setuptools", + "setuptools_scm[toml]>=6.2", "wheel" ] +[tool.setuptools_scm] + [tool.black] line-length = 120 skip-string-normalization = true diff --git a/setup.py b/setup.py index 93c71d1a..c2577886 100644 --- a/setup.py +++ b/setup.py @@ -8,20 +8,14 @@ extras = f.read().splitlines() -with open('VERSION', "r", encoding="utf-8") as v: - version = v.read() - - if __name__ == "__main__": - setup(version=version, - packages=find_packages(), + setup(packages=find_packages(), entry_points={ 'console_scripts': [ 'insolver_serving = insolver.serving.run_service:run' ] }, install_requires=required, - setup_requires=['setuptools', 'wheel'], extras_require={'full': extras}, zip_safe=False, python_requires='>=3.7', From ae24d47a4008ddd3217874da7406a852956ccf2b Mon Sep 17 00:00:00 2001 From: alexmindset Date: Thu, 28 Jul 2022 00:42:37 +0300 Subject: [PATCH 2/3] Adding `pip install insolver[dev]` --- README.md | 7 ++++--- docs/source/installation.md | 6 +++--- setup.py | 8 +++++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cc4a6fb0..63d76ffd 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,10 @@ Insolver is a low-code machine learning library, originally created for the insu ## Installation: -```shell -pip install insolver -``` +- Insolver can be installed by running `pip install insolver`. +- If you want to install insolver with all heavy requirements, install with `pip install insolver[full]`. +- If you want to install insolver with development requirements, install with `pip install insolver[dev]`. + ### Insolver is already installed in the easy access cloud via the GitHub login. Try https://mset.space with a familiar notebook-style environment. diff --git a/docs/source/installation.md b/docs/source/installation.md index d5f2f31b..dc59df08 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -13,6 +13,6 @@ pip install "git+https://github.com/MindSetLib/Insolver.git" ## Install from PyPI Insolver can be installed via pip from [PyPI](https://pypi.org/project/insolver/). -```shell -pip install insolver -``` +- Insolver can be installed by running `pip install insolver`. +- If you want to install insolver with all heavy requirements, install with `pip install insolver[full]`. +- If you want to install insolver with development requirements, install with `pip install insolver[dev]`. \ No newline at end of file diff --git a/setup.py b/setup.py index c2577886..71a1890d 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,12 @@ with open("requirements.txt") as f: required = f.read().splitlines() +with open("requirements-dev.txt") as f: + req_dev = f.read().splitlines() + +with open("./docs/requirements-docs.txt") as f: + req_dev += f.read().splitlines() + with open("requirements-extra.txt") as f: extras = f.read().splitlines() @@ -16,7 +22,7 @@ ] }, install_requires=required, - extras_require={'full': extras}, + extras_require={'full': extras, 'dev': req_dev}, zip_safe=False, python_requires='>=3.7', include_package_data=True From 2da9943ce41ad39832c7e5d79f6e2d5a643727ff Mon Sep 17 00:00:00 2001 From: alexmindset Date: Thu, 28 Jul 2022 00:48:59 +0300 Subject: [PATCH 3/3] Maintenance: Remove macOS setup step in GitHub Actions (not necessary anymore). --- .github/workflows/insolver-tests.yaml | 5 ----- .github/workflows/python-app.yml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/insolver-tests.yaml b/.github/workflows/insolver-tests.yaml index 17663bde..ecf3eeea 100644 --- a/.github/workflows/insolver-tests.yaml +++ b/.github/workflows/insolver-tests.yaml @@ -21,11 +21,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: macOS setup - if: matrix.os == 'macOS-latest' - shell: bash - run: | - brew install libomp - name: Install dependencies shell: bash run: | diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 2b58feb6..60b54ab1 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -21,11 +21,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: macOS setup - if: matrix.os == 'macOS-latest' - shell: bash - run: | - brew install libomp - name: Install dependencies shell: bash run: |