From 329c67c7c380127d0a0251fafcd6f9a1397d53d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Pe=C4=8Dnik?= Date: Fri, 11 Dec 2020 09:49:53 +0100 Subject: [PATCH 1/2] conda workflow added, setup.py --- .../templates/FEATURE_REQUEST.md | 0 .../templates/ISSUE_TEMPLATE.md | 0 .../templates/PULL_REQUEST.md | 0 .github/workflows/publish_conda.yml | 17 ++++ CONTRIBUTING.md | 6 +- conda/conda_build_config.yaml | 4 + conda/meta.yaml | 36 ++++++++ niaaml/__init__.py | 2 +- pyproject.toml | 2 +- setup.py | 86 +++++++++++++++++++ 10 files changed, 148 insertions(+), 5 deletions(-) rename FEATURE_REQUEST.md => .github/templates/FEATURE_REQUEST.md (100%) rename ISSUE_TEMPLATE.md => .github/templates/ISSUE_TEMPLATE.md (100%) rename PULL_REQUEST.md => .github/templates/PULL_REQUEST.md (100%) create mode 100644 .github/workflows/publish_conda.yml create mode 100644 conda/conda_build_config.yaml create mode 100644 conda/meta.yaml create mode 100644 setup.py diff --git a/FEATURE_REQUEST.md b/.github/templates/FEATURE_REQUEST.md similarity index 100% rename from FEATURE_REQUEST.md rename to .github/templates/FEATURE_REQUEST.md diff --git a/ISSUE_TEMPLATE.md b/.github/templates/ISSUE_TEMPLATE.md similarity index 100% rename from ISSUE_TEMPLATE.md rename to .github/templates/ISSUE_TEMPLATE.md diff --git a/PULL_REQUEST.md b/.github/templates/PULL_REQUEST.md similarity index 100% rename from PULL_REQUEST.md rename to .github/templates/PULL_REQUEST.md diff --git a/.github/workflows/publish_conda.yml b/.github/workflows/publish_conda.yml new file mode 100644 index 0000000..6d73344 --- /dev/null +++ b/.github/workflows/publish_conda.yml @@ -0,0 +1,17 @@ +name: publish_conda + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: publish-to-conda + uses: fcakyon/conda-publish-action@v1.3 + with: + subdir: 'conda' + anacondatoken: ${{ secrets.ANACONDA_TOKEN }} + platforms: 'win osx linux' \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7c8021..6913431 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,15 +7,15 @@ This project and everyone participating in it is governed by the [NiaAML Code of ## How Can I Contribute? ### Reporting Bugs -Before creating bug reports, please check existing issues list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible in the [issue template](ISSUE_TEMPLATE.md). +Before creating bug reports, please check existing issues list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible in the [issue template](.github/templates/ISSUE_TEMPLATE.md). ### Suggesting Enhancements -Open new issue using the [feature request template](FEATURE_REQUEST.md). +Open new issue using the [feature request template](.github/templates/FEATURE_REQUEST.md). ### Pull requests -Fill in the [pull request template](PULL_REQUEST.md) and make sure your code is documented. +Fill in the [pull request template](.github/templates/PULL_REQUEST.md) and make sure your code is documented. ## Setup development environment diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml new file mode 100644 index 0000000..d5d05c5 --- /dev/null +++ b/conda/conda_build_config.yaml @@ -0,0 +1,4 @@ +python: + - 3.6 + - 3.7 + - 3.8 \ No newline at end of file diff --git a/conda/meta.yaml b/conda/meta.yaml new file mode 100644 index 0000000..6cb3b41 --- /dev/null +++ b/conda/meta.yaml @@ -0,0 +1,36 @@ +{% set data = load_setup_py_data() %} + +package: + name: niaaml + version: {{ data['version'] }} + +source: + path: .. + +build: + number: 0 + script: python setup.py install --single-version-externally-managed --record=record.txt + +requirements: + build: + - python>=3.6.1 + - numpy>=1.19.1 + - scikit-learn>=0.23.2 + - NiaPy>=2.0.0rc11 + - pandas>=1.1.4 + + run: + - python>=3.6.1 + - numpy>=1.19.1 + - scikit-learn>=0.23.2 + - NiaPy>=2.0.0rc11 + - pandas>=1.1.4 + +test: + imports: + - niaaml + +about: + home: {{ data['url'] }} + license: {{ data['license'] }} +summary: {{ data['description'] }} \ No newline at end of file diff --git a/niaaml/__init__.py b/niaaml/__init__.py index eeeb13d..a092da3 100644 --- a/niaaml/__init__.py +++ b/niaaml/__init__.py @@ -27,4 +27,4 @@ ] __project__ = 'niaaml' -__version__ = '1.0.0rc4' +__version__ = '1.0.0rc5' diff --git a/pyproject.toml b/pyproject.toml index 05d531f..94c146f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "NiaAML" -version = "1.0.0rc4" +version = "1.0.0rc5" description = "Python automated machine learning framework." license = "MIT" authors = ["Luka Pečnik ", "Iztok Fister Jr. "] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4700647 --- /dev/null +++ b/setup.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +"""Setup script for the package.""" + +import io +import os +import sys +import logging + +import setuptools + + +PACKAGE_NAME = 'niaaml' +MINIMUM_PYTHON_VERSION = '3.6.1' + + +def check_python_version(): + """Exit when the Python version is too low.""" + if sys.version < MINIMUM_PYTHON_VERSION: + sys.exit("Python {0}+ is required.".format(MINIMUM_PYTHON_VERSION)) + + +def read_package_variable(key, filename='__init__.py'): + """Read the value of a variable from the package without importing.""" + module_path = os.path.join(PACKAGE_NAME, filename) + with open(module_path) as module: + for line in module: + parts = line.strip().split(' ', 2) + if parts[:-1] == [key, '=']: + return parts[-1].strip("'") + logging.warning("'%s' not found in '%s'", key, module_path) + return None + + +def build_description(): + """Build a description for the project from documentation files.""" + try: + readme = io.open("README.rst", encoding="UTF-8").read() + except IOError: + return "" + else: + return readme + + +check_python_version() + +PACKAGE_VERSION = read_package_variable('__version__') + +setuptools.setup( + name=PACKAGE_NAME, + version=PACKAGE_VERSION, + description=""" + Python automated machine learning framework. + """, + url='https://github.com/lukapecnik/NiaAML', + author='lukapecnik', + author_email='lukapecnik96@gmail.com', + packages=setuptools.find_packages(), + long_description=build_description(), + license='MIT', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Topic :: Scientific/Engineering', + 'Topic :: Software Development' + ], + tests_requires=[ + 'sphinx >= 3.3.1' + 'sphinx-rtd-theme >= 0.5.0' + 'coveralls >= 2.2.0' + ], + install_requires=[ + 'numpy >= 1.19.1', + 'scikit-learn >= 0.23.2', + 'NiaPy >= 2.0.0rc11', + 'pandas >= 1.1.4' + ] +) From a79c98c74171504bf7ca33efc80d2c2bf27e1dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Pe=C4=8Dnik?= Date: Fri, 11 Dec 2020 10:00:14 +0100 Subject: [PATCH 2/2] readme update [ci skip] --- README.md | 20 ++++++++++++++++++++ README.rst | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/README.md b/README.md index 22ca83d..d4e8860 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ The NiaAML framework allows you not only to run full pipeline optimization, but ## Installation +### pip + Install NiaAML with pip: ```sh @@ -36,6 +38,24 @@ In case you would like to try out the latest pre-release version of the framewor pip install niaaml --pre ``` +### conda + +To install NiaAML with conda, use: + +```sh +$ conda install -c lukapecnik niaaml +``` + +### Install From Source + +In case you want to install directly from the source code, use: + +```sh +$ git clone https://github.com/lukapecnik/NiaAML.git +$ cd NiaAML +$ python setup.py install +``` + ## Graphical User Interface There is a simple Graphical User Interface for the NiaAML package available [here](https://github.com/lukapecnik/NiaAML-GUI). diff --git a/README.rst b/README.rst index 997f956..c481777 100644 --- a/README.rst +++ b/README.rst @@ -37,6 +37,9 @@ The NiaAML framework allows you not only to run full pipeline optimization, but Installation ------------ +pip +~~~ + Install NiaAML with pip: .. code:: sh @@ -49,6 +52,26 @@ In case you would like to try out the latest pre-release version of the framewor pip install niaaml --pre +conda +~~~~~ + +To install NiaAML with conda, use: + +.. code:: sh + + conda install -c lukapecnik niaaml + +Install From Source +~~~~~~~~~~~~~~~~~~~ + +In case you want to install directly from the source code, use: + +.. code:: sh + + git clone https://github.com/lukapecnik/NiaAML.git + cd NiaAML + python setup.py install + Graphical User Interface ------------------------