diff --git a/.bandit b/.bandit index 97ef0d4..474c8c6 100644 --- a/.bandit +++ b/.bandit @@ -1,6 +1,2 @@ - -# (optional) list included test IDs here, eg '[B101, B406]': -# tests: - -# (optional) list skipped test IDs here, eg '[B101, B406]': -skips: ['B101'] +[bandit] +skips: B101,B307,B311 diff --git a/.condarc b/.condarc index 4ce4fa1..a16afbc 100644 --- a/.condarc +++ b/.condarc @@ -1,7 +1,8 @@ pinned_packages: - python=2 - - pyqt=4 + - pyqt=4.11.4=py27_5 channels: - defaults + - free - dataonlygreater diff --git a/.pylintrc b/.pylintrc index 4b95dc9..7de130e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -139,7 +139,8 @@ disable=print-statement, trailing-newlines, bad-continuation, multiple-statements, - import-error + import-error, + missing-docstring # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/CHANGELOG.md b/CHANGELOG.md index f1fed60..09a6c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,40 +5,54 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.10.1] - 2022-04-12 + +### Changed + +- Use the appveyor configuration file as the single source for the version + number. + +### Removed + +- Removed `__build__` and `__version__` dunders. + +### Fixed + +- Fixed minimum pandas dependency version. +- Fixed codacy configuration. + ## [0.10.0] - 2019-03-12 ### Added -- Added change log. -- Added CI files -- Added python-magic as a dependency. -- Added pagination to DataFrameModel to accelerate loading times. +- Added change log. +- Added CI files +- Added python-magic as a dependency. +- Added pagination to DataFrameModel to accelerate loading times. ### Removed -- Removed unused ui module (which contained a copy of easygui) and german - translations. -- Removed packaged libmagic library due to version conflicts. +- Removed unused ui module (which contained a copy of easygui) and german + translations. +- Removed packaged libmagic library due to version conflicts. ### Fixed -- Fixed incorrect use of Pandas ix method which read wrong table rows. -- Fixed reference to pandasqt in MANIFEST.in which caused crash. -- Fixed various bugs with use of QVariant v2 API, which is not default for - Python 2. -- Fixed bugs with comparison of QStrings to Python strings. -- Fixed incorrect format (python 3) for validator return value in remove column - dialog of a DataTable widget. -- Fixed various depreciated pandas API issues. - +- Fixed incorrect use of Pandas ix method which read wrong table rows. +- Fixed reference to pandasqt in MANIFEST.in which caused crash. +- Fixed various bugs with use of QVariant v2 API, which is not default for + Python 2. +- Fixed bugs with comparison of QStrings to Python strings. +- Fixed incorrect format (python 3) for validator return value in remove + column dialog of a DataTable widget. +- Fixed various depreciated pandas API issues. ## [0.9.0] - 2017-02-23 ### Added -- Initial import of pandas-qt from SETIS. +- Initial import of pandas-qt from SETIS. ### Changed -- Changed package name to dtocean-qt. - +- Changed package name to dtocean-qt. diff --git a/README.md b/README.md index 8372c2a..ddc06f9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![appveyor](https://ci.appveyor.com/api/projects/status/github/DTOcean/dtocean-qt?branch=master&svg=true)](https://ci.appveyor.com/project/DTOcean/dtocean-qt) [![codecov](https://codecov.io/gh/DTOcean/dtocean-qt/branch/master/graph/badge.svg)](https://codecov.io/gh/DTOcean/dtocean-qt) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d1e19e7a286a4e76a90d19b021bc9aca)](https://www.codacy.com/project/H0R5E/dtocean-qt/dashboard?utm_source=github.com&utm_medium=referral&utm_content=DTOcean/dtocean-qt&utm_campaign=Badge_Grade_Dashboard&branchId=11757312) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/7349c8189d9d4466a46cb8dffd94d418)](https://www.codacy.com/gh/DTOcean/dtocean-qt/dashboard?utm_source=github.com&utm_medium=referral&utm_content=DTOcean/dtocean-qt&utm_campaign=Badge_Grade) [![release](https://img.shields.io/github/release/DTOcean/dtocean-qt.svg)](https://github.com/DTOcean/dtocean-qt/releases/latest) # dtocean-qt @@ -9,7 +9,7 @@ Utilities to use pandas (the data analysis / manipulation library for Python) with Qt within the DTOcean software suite. This package is a dependency of [dtocean-app](https://github.com/DTOcean/dtocean-app). -* For python 2.7 only. +\* For python 2.7 only. ## Installation @@ -30,7 +30,7 @@ Conda can be used to install dependencies into a dedicated environment from the source code root directory: ``` -$ conda create -n _dtocean_qt python=2.7 pip +$ conda create -n _dtocean_qt python=2.7 pip pyyaml ``` Activate the environment, then copy the `.condrc` file to store installation @@ -69,8 +69,7 @@ $ conda activate _dtocean_qt Install packages required for testing to the environment (one time only): ``` -$ conda install -y pytest -$ conda install -y -c conda-forge pytest-qt +$ conda install -y -c conda-forge "pytest<4" pytest-qt ``` Run the tests: diff --git a/appveyor.yml b/appveyor.yml index 4d83afb..f1c7869 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,15 +7,8 @@ # general configuration # #---------------------------------# -# Build only for commits to certain locations -only_commits: - files: - - dtocean_qt/ - - tests/ - - setup.py - # version format -version: 0.10.0.build{build} +version: 0.10.1.build{build} environment: matrix: @@ -27,7 +20,6 @@ environment: MINICONDA: C:\Miniconda-x64 ARCH: "64" - init: - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # RDP - "ECHO %PYTHON_VERSION% %MINICONDA%" @@ -37,13 +29,12 @@ install: - conda config --set always_yes yes --set changeps1 no - conda update --quiet conda - conda info --all - - conda create -n _dtocean_qt python=%PYTHON_VERSION% pip + - conda create -n _dtocean_qt python=%PYTHON_VERSION% pip pyyaml - activate _dtocean_qt - copy .condarc %CONDA_PREFIX% - conda install --file requirements-conda-dev.txt - pip install -e . - - conda install pytest pytest-cov - - conda install -c conda-forge pytest-qt + - conda install -c conda-forge "pytest<4" pytest-qt pytest-cov build: off @@ -52,4 +43,4 @@ test_script: after_test: - pip install codecov - - codecov \ No newline at end of file + - codecov diff --git a/dtocean_qt/__init__.py b/dtocean_qt/__init__.py index 477506e..40a96af 100644 --- a/dtocean_qt/__init__.py +++ b/dtocean_qt/__init__.py @@ -1,4 +1 @@ # -*- coding: utf-8 -*- - -__build__ = '0.10.0-0' -__version__ = '0.10.0' \ No newline at end of file diff --git a/requirements-conda-dev.txt b/requirements-conda-dev.txt index 7f6f409..2aef471 100644 --- a/requirements-conda-dev.txt +++ b/requirements-conda-dev.txt @@ -1,6 +1,6 @@ # REQUIREMENTS FOR CONDA INSTALLATION (EXCLUDING DTOCEAN PACKAGES) easygui -pandas +pandas >=0.23 python-magic pyqt <5 setuptools diff --git a/setup.py b/setup.py index d3f486e..446502e 100644 --- a/setup.py +++ b/setup.py @@ -1,33 +1,10 @@ -from __future__ import print_function - -import io -import os -import re import sys + +import yaml from setuptools import setup from setuptools.command.test import test as TestCommand -here = os.path.abspath(os.path.dirname(__file__)) - -version_file = open(os.path.join(here, 'dtocean_qt', '__init__.py'), 'rU') -__version__ = re.sub( - r".*\b__version__\s+=\s+'([^']+)'.*", - r'\1', - [line.strip() for line in version_file if '__version__' in line].pop(0) -) -version_file.close() - - -def read(*filenames, **kwargs): - encoding = kwargs.get('encoding', 'utf-8') - sep = kwargs.get('sep', '\n') - buf = [] - for filename in filenames: - with io.open(filename, encoding=encoding) as f: - buf.append(f.read()) - return sep.join(buf) - class PyTest(TestCommand): def finalize_options(self): @@ -40,9 +17,29 @@ def run_tests(self): errcode = pytest.main(self.test_args) sys.exit(errcode) + +def read_yaml(rel_path): + with open(rel_path, 'r') as stream: + data_loaded = yaml.safe_load(stream) + return data_loaded + + +def get_appveyor_version(): + + data = read_yaml("appveyor.yml") + + if "version" not in data: + raise RuntimeError("Unable to find version string.") + + appveyor_version = data["version"] + last_dot_idx = appveyor_version.rindex(".") + + return appveyor_version[:last_dot_idx] + + setup( name='dtocean-qt', - version=__version__, + version=get_appveyor_version(), license='MIT License', maintainer='Mathew Topper', maintainer_email='mathew.topper@dataonlygreater.com', @@ -50,7 +47,7 @@ def run_tests(self): 'library for Python) with Qt.'), packages=['dtocean_qt'], install_requires=['easygui', - 'pandas', + 'pandas>=0.23', # 'PyQt4', 'python-magic', # 'sip' @@ -71,4 +68,4 @@ def run_tests(self): 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: User Interfaces' ] -) \ No newline at end of file +)