From 03e67fa554160d1c5b4dfdb834c2fe3b78e90748 Mon Sep 17 00:00:00 2001 From: bishax Date: Mon, 8 Mar 2021 13:40:34 +0000 Subject: [PATCH] Clear master --- .cookiecutter.json | 10 -- .darglint | 2 - .flake8 | 25 ----- .gitattributes | 1 - .github/dependabot.yml | 18 ---- .github/labels.yml | 66 ------------ .github/release-drafter.yml | 29 ------ .github/workflows/constraints.txt | 5 - .github/workflows/labeler.yml | 19 ---- .github/workflows/release.yml | 79 -------------- .github/workflows/tests.yml | 141 ------------------------- .gitignore | 12 --- .pre-commit-config.yaml | 51 --------- .readthedocs.yml | 9 -- CONTRIBUTING.rst | 123 ---------------------- LICENSE.rst | 22 ---- README.rst | 100 ------------------ codecov.yml | 9 -- docs/conf.py | 15 --- docs/contributing.rst | 4 - docs/index.rst | 15 --- docs/license.rst | 1 - docs/reference.rst | 13 --- docs/requirements.txt | 3 - docs/usage.rst | 6 -- mypy.ini | 20 ---- noxfile.py | 166 ------------------------------ pyproject.toml | 64 ------------ src/ds_utils/__init__.py | 1 - src/ds_utils/__main__.py | 12 --- src/ds_utils/py.typed | 0 tests/__init__.py | 1 - tests/test_main.py | 17 --- 33 files changed, 1059 deletions(-) delete mode 100644 .cookiecutter.json delete mode 100644 .darglint delete mode 100644 .flake8 delete mode 100644 .gitattributes delete mode 100644 .github/dependabot.yml delete mode 100644 .github/labels.yml delete mode 100644 .github/release-drafter.yml delete mode 100644 .github/workflows/constraints.txt delete mode 100644 .github/workflows/labeler.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/tests.yml delete mode 100644 .gitignore delete mode 100644 .pre-commit-config.yaml delete mode 100644 .readthedocs.yml delete mode 100644 CONTRIBUTING.rst delete mode 100644 LICENSE.rst delete mode 100644 README.rst delete mode 100644 codecov.yml delete mode 100644 docs/conf.py delete mode 100644 docs/contributing.rst delete mode 100644 docs/index.rst delete mode 100644 docs/license.rst delete mode 100644 docs/reference.rst delete mode 100644 docs/requirements.txt delete mode 100644 docs/usage.rst delete mode 100644 mypy.ini delete mode 100644 noxfile.py delete mode 100644 pyproject.toml delete mode 100644 src/ds_utils/__init__.py delete mode 100644 src/ds_utils/__main__.py delete mode 100644 src/ds_utils/py.typed delete mode 100644 tests/__init__.py delete mode 100644 tests/test_main.py diff --git a/.cookiecutter.json b/.cookiecutter.json deleted file mode 100644 index edb8180..0000000 --- a/.cookiecutter.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "_template": "gh:cjolowicz/cookiecutter-hypermodern-python", - "author": "Nesta", - "email": "software_development@nesta.org.uk", - "friendly_name": "Nesta Data Science Utilities", - "github_user": "nestauk", - "package_name": "ds_utils", - "project_name": "ds-utils", - "version": "0.0.0" -} diff --git a/.darglint b/.darglint deleted file mode 100644 index 2b03755..0000000 --- a/.darglint +++ /dev/null @@ -1,2 +0,0 @@ -[darglint] -strictness = short diff --git a/.flake8 b/.flake8 deleted file mode 100644 index a5e3c4b..0000000 --- a/.flake8 +++ /dev/null @@ -1,25 +0,0 @@ -[flake8] -# ANN - annotations -# B,B9 - Bugbear -# BLK - Black -# C - complexity -# D - docstrings -# DAR - darglint (checks docstrings) -# E - pycodestyle errors -# F - pyflakes -# I - Import order -# N - PEP8 naming -# W - pycodestyle warnings -select = ANN,B,B9,BLK,C,D,DAR,E,F,I,N,W -# E203 - whitespace before ':' -# E501 - line length (dealt with by bugbear) -# W503 - linebreak before binary op -ignore = E203,E501,W503 -max-complexity = 10 -max-line-length = 80 -application-import-names = ds_utils,tests -import-order-style = google -per-file-ignores = - tests/*:ANN - noxfile.py:ANN -docstring-convention = google diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 6313b56..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index a0a5c73..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - - package-ecosystem: pip - directory: "/.github/workflows" - schedule: - interval: daily - - package-ecosystem: pip - directory: "/docs" - schedule: - interval: daily - - package-ecosystem: pip - directory: "/" - schedule: - interval: daily diff --git a/.github/labels.yml b/.github/labels.yml deleted file mode 100644 index f7f83aa..0000000 --- a/.github/labels.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -# Labels names are important as they are used by Release Drafter to decide -# regarding where to record them in changelog or if to skip them. -# -# The repository labels will be automatically configured using this file and -# the GitHub Action https://github.com/marketplace/actions/github-labeler. -- name: breaking - description: Breaking Changes - color: bfd4f2 -- name: bug - description: Something isn't working - color: d73a4a -- name: build - description: Build System and Dependencies - color: bfdadc -- name: ci - description: Continuous Integration - color: 4a97d6 -- name: dependencies - description: Pull requests that update a dependency file - color: 0366d6 -- name: documentation - description: Improvements or additions to documentation - color: 0075ca -- name: duplicate - description: This issue or pull request already exists - color: cfd3d7 -- name: enhancement - description: New feature or request - color: a2eeef -- name: github_actions - description: Pull requests that update Github_actions code - color: "000000" -- name: good first issue - description: Good for newcomers - color: 7057ff -- name: help wanted - description: Extra attention is needed - color: 008672 -- name: invalid - description: This doesn't seem right - color: e4e669 -- name: performance - description: Performance - color: "016175" -- name: python - description: Pull requests that update Python code - color: 2b67c6 -- name: question - description: Further information is requested - color: d876e3 -- name: refactoring - description: Refactoring - color: ef67c4 -- name: removal - description: Removals and Deprecations - color: 9ae7ea -- name: style - description: Style - color: c120e5 -- name: testing - description: Testing - color: b1fc6f -- name: wontfix - description: This will not be worked on - color: ffffff diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 7a04410..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,29 +0,0 @@ -categories: - - title: ":boom: Breaking Changes" - label: "breaking" - - title: ":rocket: Features" - label: "enhancement" - - title: ":fire: Removals and Deprecations" - label: "removal" - - title: ":beetle: Fixes" - label: "bug" - - title: ":racehorse: Performance" - label: "performance" - - title: ":rotating_light: Testing" - label: "testing" - - title: ":construction_worker: Continuous Integration" - label: "ci" - - title: ":books: Documentation" - label: "documentation" - - title: ":hammer: Refactoring" - label: "refactoring" - - title: ":lipstick: Style" - label: "style" - - title: ":package: Dependencies" - labels: - - "dependencies" - - "build" -template: | - ## Changes - - $CHANGES diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt deleted file mode 100644 index dbd6c9f..0000000 --- a/.github/workflows/constraints.txt +++ /dev/null @@ -1,5 +0,0 @@ -pip==21.0 -nox==2020.12.31 -nox-poetry==0.7.1 -poetry==1.1.4 -virtualenv==20.4.0 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index f62967b..0000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Labeler - -on: - push: - branches: - - main - - master - -jobs: - labeler: - runs-on: ubuntu-latest - steps: - - name: Check out the repository - uses: actions/checkout@v2.3.3 - - - name: Run Labeler - uses: crazy-max/ghaction-github-labeler@v3.1.1 - with: - skip-delete: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 337bc9a..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Release - -on: - push: - branches: - - main - - master - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Check out the repository - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 2 - - - name: Set up Python - uses: actions/setup-python@v2.2.1 - with: - python-version: "3.9" - - - name: Upgrade pip - run: | - pip install --constraint=.github/workflows/constraints.txt pip - pip --version - - - name: Install Poetry - run: | - pip install --constraint=.github/workflows/constraints.txt poetry - poetry --version - - - name: Check if there is a parent commit - id: check-parent-commit - run: | - echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)" - - - name: Detect and tag new version - id: check-version - if: steps.check-parent-commit.outputs.sha - uses: salsify/action-detect-and-tag-new-version@v2.0.1 - with: - version-command: | - bash -o pipefail -c "poetry version | awk '{ print \$2 }'" - - - name: Bump version for developmental release - if: "! steps.check-version.outputs.tag" - run: | - poetry version patch && - version=$(poetry version | awk '{ print $2 }') && - poetry version $version.dev.$(date +%s) - - - name: Build package - run: | - poetry build --ansi - - - name: Publish package on PyPI - if: steps.check-version.outputs.tag - uses: pypa/gh-action-pypi-publish@v1.4.1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} - - - name: Publish package on TestPyPI - if: "! steps.check-version.outputs.tag" - uses: pypa/gh-action-pypi-publish@v1.4.1 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - - - name: Publish the release notes - uses: release-drafter/release-drafter@v5.13.0 - with: - publish: ${{ steps.check-version.outputs.tag != '' }} - tag: ${{ steps.check-version.outputs.tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index c8989f4..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: Tests - -on: - - push - - pull_request - -jobs: - tests: - name: ${{ matrix.session }} ${{ matrix.python-version }} / ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" } - - { python-version: 3.9, os: ubuntu-latest, session: "safety" } - - { python-version: 3.9, os: ubuntu-latest, session: "mypy" } - - { python-version: 3.8, os: ubuntu-latest, session: "mypy" } - - { python-version: 3.7, os: ubuntu-latest, session: "mypy" } - - { python-version: 3.6, os: ubuntu-latest, session: "mypy" } - - { python-version: 3.9, os: ubuntu-latest, session: "tests" } - - { python-version: 3.8, os: ubuntu-latest, session: "tests" } - - { python-version: 3.7, os: ubuntu-latest, session: "tests" } - - { python-version: 3.6, os: ubuntu-latest, session: "tests" } - - { python-version: 3.9, os: windows-latest, session: "tests" } - - { python-version: 3.9, os: macos-latest, session: "tests" } - - { python-version: 3.9, os: ubuntu-latest, session: "typeguard" } - - { python-version: 3.9, os: ubuntu-latest, session: "xdoctest" } - - { python-version: 3.8, os: ubuntu-latest, session: "docs-build" } - - env: - NOXSESSION: ${{ matrix.session }} - - steps: - - name: Check out the repository - uses: actions/checkout@v2.3.4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2.2.1 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip - run: | - pip install --constraint=.github/workflows/constraints.txt pip - pip --version - - - name: Install Poetry - run: | - pip install --constraint=.github/workflows/constraints.txt poetry - poetry --version - - - name: Install Nox - run: | - pip install --constraint=.github/workflows/constraints.txt nox nox-poetry - nox --version - - - name: Compute pre-commit cache key - if: matrix.session == 'pre-commit' - id: pre-commit-cache - shell: python - run: | - import hashlib - import sys - - python = "py{}.{}".format(*sys.version_info[:2]) - payload = sys.version.encode() + sys.executable.encode() - digest = hashlib.sha256(payload).hexdigest() - result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8]) - - print("::set-output name=result::{}".format(result)) - - - name: Restore pre-commit cache - uses: actions/cache@v2.1.3 - if: matrix.session == 'pre-commit' - with: - path: ~/.cache/pre-commit - key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }} - restore-keys: | - ${{ steps.pre-commit-cache.outputs.result }}- - - - name: Run Nox - run: | - nox --force-color --python=${{ matrix.python-version }} - - - name: Upload coverage data - if: always() && matrix.session == 'tests' - uses: "actions/upload-artifact@v2.2.2" - with: - name: coverage-data - path: ".coverage.*" - - - name: Upload documentation - if: matrix.session == 'docs-build' - uses: actions/upload-artifact@v2.2.2 - with: - name: docs - path: docs/_build - - coverage: - runs-on: ubuntu-latest - needs: tests - steps: - - name: Check out the repository - uses: actions/checkout@v2.3.4 - - - name: Set up Python 3.9 - uses: actions/setup-python@v2.2.1 - with: - python-version: 3.9 - - - name: Upgrade pip - run: | - pip install --constraint=.github/workflows/constraints.txt pip - pip --version - - - name: Install Poetry - run: | - pip install --constraint=.github/workflows/constraints.txt poetry - poetry --version - - - name: Install Nox - run: | - pip install --constraint=.github/workflows/constraints.txt nox nox-poetry - nox --version - - - name: Download coverage data - uses: actions/download-artifact@v2.0.8 - with: - name: coverage-data - - - name: Combine coverage data and display human readable report - run: | - nox --force-color --session=coverage - - - name: Create coverage report - run: | - nox --force-color --session=coverage -- xml - - - name: Upload coverage report - uses: codecov/codecov-action@v1.2.1 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5ebe1f2..0000000 --- a/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -*~ - -poetry.lock -.mypy_cache/ -/.coverage -/.nox/ -/.python-version -/.pytype/ -/dist/ -/docs/_build/ -/src/*.egg-info/ -__pycache__/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 9af7992..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,51 +0,0 @@ -repos: - - repo: local - hooks: - - id: black - name: black - entry: black - language: system - types: [python] - require_serial: true - - id: check-added-large-files - name: Check for added large files - entry: check-added-large-files - language: system - - id: check-toml - name: Check Toml - entry: check-toml - language: system - types: [toml] - - id: check-yaml - name: Check Yaml - entry: check-yaml - language: system - types: [yaml] - - id: end-of-file-fixer - name: Fix End of Files - entry: end-of-file-fixer - language: system - types: [text] - stages: [commit, push, manual] - - id: flake8 - name: flake8 - entry: flake8 - language: system - types: [python] - require_serial: true - - id: reorder-python-imports - name: Reorder python imports - entry: reorder-python-imports - language: system - types: [python] - args: [--application-directories=src] - - id: trailing-whitespace - name: Trim Trailing Whitespace - entry: trailing-whitespace-fixer - language: system - types: [text] - stages: [commit, push, manual] - - repo: https://github.com/prettier/pre-commit - rev: v2.1.2 - hooks: - - id: prettier diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index aaf2993..0000000 --- a/.readthedocs.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 2 -sphinx: - configuration: docs/conf.py -formats: all -python: - version: 3.8 - install: - - requirements: docs/requirements.txt - - path: . diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 85f78f4..0000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,123 +0,0 @@ -Contributor Guide -================= - -Thank you for your interest in improving this project. -This project is open-source under the `MIT license`_ and -welcomes contributions in the form of bug reports, feature requests, and pull requests. - -Here is a list of important resources for contributors: - -- `Source Code`_ -- `Documentation`_ -- `Issue Tracker`_ -- `Code of Conduct`_ - -.. _MIT license: https://opensource.org/licenses/MIT -.. _Source Code: https://github.com/nestauk/ds-utils -.. _Documentation: https://ds-utils.readthedocs.io/ -.. _Issue Tracker: https://github.com/nestauk/ds-utils/issues - -How to report a bug -------------------- - -Report bugs on the `Issue Tracker`_. - -When filing an issue, make sure to answer these questions: - -- Which operating system and Python version are you using? -- Which version of this project are you using? -- What did you do? -- What did you expect to see? -- What did you see instead? - -The best way to get your bug fixed is to provide a test case, -and/or steps to reproduce the issue. - - -How to request a feature ------------------------- - -Request features on the `Issue Tracker`_. - - -How to set up your development environment ------------------------------------------- - -You need Python 3.6+ and the following tools: - -- Poetry_ -- Nox_ -- nox-poetry_ - -Install the package with development requirements: - -.. code:: console - - $ poetry install - -You can now run an interactive Python session, -or the command-line interface: - -.. code:: console - - $ poetry run python - $ poetry run ds-utils - -.. _Poetry: https://python-poetry.org/ -.. _Nox: https://nox.thea.codes/ -.. _nox-poetry: https://nox-poetry.readthedocs.io/ - - -How to test the project ------------------------ - -Run the full test suite: - -.. code:: console - - $ nox - -List the available Nox sessions: - -.. code:: console - - $ nox --list-sessions - -You can also run a specific Nox session. -For example, invoke the unit test suite like this: - -.. code:: console - - $ nox --session=tests - -Unit tests are located in the ``tests`` directory, -and are written using the pytest_ testing framework. - -.. _pytest: https://pytest.readthedocs.io/ - - -How to submit changes ---------------------- - -Open a `pull request`_ to submit changes to this project. - -Your pull request needs to meet the following guidelines for acceptance: - -- The Nox test suite must pass without errors and warnings. -- Include unit tests. This project maintains 100% code coverage. -- If your changes add functionality, update the documentation accordingly. - -Feel free to submit early, though—we can always iterate on this. - -To run linting and code formatting checks before commiting your change, you can install pre-commit as a Git hook by running the following command: - -.. code:: console - - $ nox --session=pre-commit -- install - -It is recommended to open an issue before starting work on anything. -This will allow a chance to talk it over with the owners and validate your approach. - -.. _pull request: https://github.com/nestauk/ds-utils/pulls -.. github-only -.. _Code of Conduct: CODE_OF_CONDUCT.rst diff --git a/LICENSE.rst b/LICENSE.rst deleted file mode 100644 index 203bbb0..0000000 --- a/LICENSE.rst +++ /dev/null @@ -1,22 +0,0 @@ -MIT License -=========== - -Copyright © 2020 Nesta - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -**The software is provided "as is", without warranty of any kind, express or -implied, including but not limited to the warranties of merchantability, -fitness for a particular purpose and noninfringement. In no event shall the -authors or copyright holders be liable for any claim, damages or other -liability, whether in an action of contract, tort or otherwise, arising from, -out of or in connection with the software or the use or other dealings in the -software.** diff --git a/README.rst b/README.rst deleted file mode 100644 index 445c9ec..0000000 --- a/README.rst +++ /dev/null @@ -1,100 +0,0 @@ -Nesta Data Science Utilities -============================ - -|PyPI| |Python Version| |License| - -|Read the Docs| |Tests| |Codecov| - -|pre-commit| |Black| - -.. |PyPI| image:: https://img.shields.io/pypi/v/ds-utils.svg - :target: https://pypi.org/project/ds-utils/ - :alt: PyPI -.. |Python Version| image:: https://img.shields.io/pypi/pyversions/ds-utils - :target: https://pypi.org/project/ds-utils - :alt: Python Version -.. |License| image:: https://img.shields.io/pypi/l/ds-utils - :target: https://opensource.org/licenses/MIT - :alt: License -.. |Read the Docs| image:: https://img.shields.io/readthedocs/ds-utils/latest.svg?label=Read%20the%20Docs - :target: https://ds-utils.readthedocs.io/ - :alt: Read the documentation at https://ds-utils.readthedocs.io/ -.. |Tests| image:: https://github.com/nestauk/ds-utils/workflows/Tests/badge.svg - :target: https://github.com/nestauk/ds-utils/actions?workflow=Tests - :alt: Tests -.. |Codecov| image:: https://codecov.io/gh/nestauk/ds-utils/branch/master/graph/badge.svg - :target: https://codecov.io/gh/nestauk/ds-utils - :alt: Codecov -.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white - :target: https://github.com/pre-commit/pre-commit - :alt: pre-commit -.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - :alt: Black - - -Features --------- - -* TODO - - -Requirements ------------- - -* TODO - - -Installation ------------- - -You can install *Nesta Data Science Utilities* via pip_ from PyPI_: - -.. code:: console - - $ pip install ds-utils - - -Usage ------ - -Please see the `Command-line Reference `_ for details. - - -Contributing ------------- - -Contributions are very welcome. -To learn more, see the `Contributor Guide`_. - - -License -------- - -Distributed under the terms of the MIT_ license, -*Nesta Data Science Utilities* is free and open source software. - - -Issues ------- - -If you encounter any problems, -please `file an issue`_ along with a detailed description. - - -Credits -------- - -This project was generated from `@cjolowicz`_'s `Hypermodern Python Cookiecutter`_ template. - - -.. _@cjolowicz: https://github.com/cjolowicz -.. _Cookiecutter: https://github.com/audreyr/cookiecutter -.. _MIT: http://opensource.org/licenses/MIT -.. _PyPI: https://pypi.org/ -.. _Hypermodern Python Cookiecutter: https://github.com/cjolowicz/cookiecutter-hypermodern-python -.. _file an issue: https://github.com/nestauk/ds-utils/issues -.. _pip: https://pip.pypa.io/ -.. github-only -.. _Contributor Guide: CONTRIBUTING.rst -.. _Usage: https://ds-utils.readthedocs.io/en/latest/usage.html diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 9ac2650..0000000 --- a/codecov.yml +++ /dev/null @@ -1,9 +0,0 @@ -comment: false -coverage: - status: - project: - default: - target: "100" - patch: - default: - target: "100" diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 9645f8c..0000000 --- a/docs/conf.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Sphinx configuration.""" -from datetime import datetime - - -project = "Nesta Data Science Utilities" -author = "Nesta" -copyright = f"{datetime.now().year}, {author}" -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.napoleon", - "sphinx_click", - "sphinx_rtd_theme", -] -autodoc_typehints = "description" -html_theme = "sphinx_rtd_theme" diff --git a/docs/contributing.rst b/docs/contributing.rst deleted file mode 100644 index c8670b6..0000000 --- a/docs/contributing.rst +++ /dev/null @@ -1,4 +0,0 @@ -.. include:: ../CONTRIBUTING.rst - :end-before: github-only - -.. _Code of Conduct: codeofconduct.html diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 6b62669..0000000 --- a/docs/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. include:: ../README.rst - :end-before: github-only - -.. _Contributor Guide: contributing.html -.. _Usage: usage.html - -.. toctree:: - :hidden: - :maxdepth: 1 - - usage - reference - contributing - License - Changelog diff --git a/docs/license.rst b/docs/license.rst deleted file mode 100644 index 68c5792..0000000 --- a/docs/license.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../LICENSE.rst diff --git a/docs/reference.rst b/docs/reference.rst deleted file mode 100644 index 309e8f1..0000000 --- a/docs/reference.rst +++ /dev/null @@ -1,13 +0,0 @@ -Reference -========= - -.. contents:: - :local: - :backlinks: none - - -ds_utils.__main__ ------------------ - -.. automodule:: ds_utils.__main__ - :members: diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 7df8632..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinx==3.4.3 -sphinx-click==2.5.0 -sphinx-rtd-theme==0.5.1 diff --git a/docs/usage.rst b/docs/usage.rst deleted file mode 100644 index 5250a83..0000000 --- a/docs/usage.rst +++ /dev/null @@ -1,6 +0,0 @@ -Usage -===== - -.. click:: ds_utils.__main__:main - :prog: ds-utils - :nested: full diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 4f2123c..0000000 --- a/mypy.ini +++ /dev/null @@ -1,20 +0,0 @@ -[mypy] -check_untyped_defs = True -disallow_any_generics = True -disallow_incomplete_defs = True -disallow_subclassing_any = True -disallow_untyped_calls = True -disallow_untyped_decorators = True -disallow_untyped_defs = True -no_implicit_optional = True -no_implicit_reexport = True -pretty = True -show_column_numbers = True -show_error_codes = True -show_error_context = True -strict_equality = True -warn_redundant_casts = True -warn_return_any = True -warn_unreachable = True -warn_unused_configs = True -warn_unused_ignores = True diff --git a/noxfile.py b/noxfile.py deleted file mode 100644 index 86423b9..0000000 --- a/noxfile.py +++ /dev/null @@ -1,166 +0,0 @@ -"""Nox sessions.""" -import shutil -import sys -from pathlib import Path -from textwrap import dedent - -import nox -import nox_poetry.patch # noqa: F401 -from nox.sessions import Session - - -package = "ds_utils" -python_versions = ["3.9", "3.8", "3.7", "3.6"] -nox.options.sessions = ( - "pre-commit", - "mypy", - "tests", - "xdoctest", - "docs-build", -) - - -def activate_virtualenv_in_precommit_hooks(session: Session) -> None: - """Activate virtualenv in hooks installed by pre-commit. - - This function patches git hooks installed by pre-commit to activate the - session's virtual environment. This allows pre-commit to locate hooks in - that environment when invoked from git. - - Args: - session: The Session object. - """ - if session.bin is None: - return - - virtualenv = session.env.get("VIRTUAL_ENV") - if virtualenv is None: - return - - hookdir = Path(".git") / "hooks" - if not hookdir.is_dir(): - return - - for hook in hookdir.iterdir(): - if hook.name.endswith(".sample") or not hook.is_file(): - continue - - text = hook.read_text() - bindir = repr(session.bin)[1:-1] # strip quotes - if not ( - Path("A") == Path("a") and bindir.lower() in text.lower() or bindir in text - ): - continue - - lines = text.splitlines() - if not (lines[0].startswith("#!") and "python" in lines[0].lower()): - continue - - header = dedent( - f"""\ - import os - os.environ["VIRTUAL_ENV"] = {virtualenv!r} - os.environ["PATH"] = os.pathsep.join(( - {session.bin!r}, - os.environ.get("PATH", ""), - )) - """ - ) - - lines.insert(1, header) - hook.write_text("\n".join(lines)) - - -@nox.session(name="pre-commit", python="3.9") -def precommit(session: Session) -> None: - """Lint using pre-commit.""" - args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"] - session.install( - "black", - "darglint", - "flake8", - "flake8-bugbear", - "flake8-docstrings", - "pep8-naming", - "pre-commit", - "pre-commit-hooks", - "reorder-python-imports", - ) - session.run("pre-commit", *args) - if args and args[0] == "install": - activate_virtualenv_in_precommit_hooks(session) - - -@nox.session(python=python_versions) -def mypy(session: Session) -> None: - """Type-check using mypy.""" - args = session.posargs or ["src", "tests", "docs/conf.py"] - session.install(".") - session.install("mypy", "pytest") - session.run("mypy", *args) - if not session.posargs: - session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py") - - -@nox.session(python=python_versions) -def tests(session: Session) -> None: - """Run the test suite.""" - session.install(".") - session.install("coverage[toml]", "pytest", "pygments") - try: - session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs) - finally: - if session.interactive: - session.notify("coverage") - - -@nox.session -def coverage(session: Session) -> None: - """Produce the coverage report.""" - # Do not use session.posargs unless this is the only session. - has_args = session.posargs and len(session._runner.manifest) == 1 - args = session.posargs if has_args else ["report"] - - session.install("coverage[toml]") - - if not has_args and any(Path().glob(".coverage.*")): - session.run("coverage", "combine") - - session.run("coverage", *args) - - -@nox.session(python=python_versions) -def xdoctest(session: Session) -> None: - """Run examples with xdoctest.""" - args = session.posargs or ["all"] - session.install(".") - session.install("xdoctest[colors]") - session.run("python", "-m", "xdoctest", package, *args) - - -@nox.session(name="docs-build", python="3.8") -def docs_build(session: Session) -> None: - """Build the documentation.""" - args = session.posargs or ["docs", "docs/_build"] - session.install(".") - session.install("sphinx", "sphinx-click", "sphinx-rtd-theme") - - build_dir = Path("docs", "_build") - if build_dir.exists(): - shutil.rmtree(build_dir) - - session.run("sphinx-build", *args) - - -@nox.session(python="3.8") -def docs(session: Session) -> None: - """Build and serve the documentation with live reloading on file changes.""" - args = session.posargs or ["--open-browser", "docs", "docs/_build"] - session.install(".") - session.install("sphinx", "sphinx-autobuild", "sphinx-click", "sphinx-rtd-theme") - - build_dir = Path("docs", "_build") - if build_dir.exists(): - shutil.rmtree(build_dir) - - session.run("sphinx-autobuild", *args) diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index ec0c306..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,64 +0,0 @@ -[tool.poetry] -name = "ds-utils" -version = "0.0.0" -description = "Nesta Data Science Utilities" -authors = ["Nesta "] -license = "MIT" -readme = "README.rst" -homepage = "https://github.com/nestauk/ds-utils" -repository = "https://github.com/nestauk/ds-utils" -documentation = "https://ds-utils.readthedocs.io" -classifiers = [ - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", -] - -[tool.poetry.urls] -Changelog = "https://github.com/nestauk/ds-utils/releases" - -[tool.poetry.dependencies] -python = "^3.6.1" -click = "^7.0" - -[tool.poetry.dev-dependencies] -pytest = "^6.2.2" -coverage = {extras = ["toml"], version = "^5.4"} -mypy = "^0.800" -xdoctest = {extras = ["colors"], version = "^0.15.3"} -sphinx = "^3.4.3" -sphinx-autobuild = "^2020.9.1" -pre-commit = "^2.10.0" -flake8 = "^3.8.4" -black = "^20.8b1" -flake8-bandit = "^2.1.2" -flake8-bugbear = "^20.11.1" -flake8-docstrings = "^1.5.0" -pep8-naming = "^0.11.1" -darglint = "^1.5.8" -reorder-python-imports = "^2.3.6" -pre-commit-hooks = "^3.4.0" -sphinx-rtd-theme = "^0.5.1" -sphinx-click = "^2.5.0" -Pygments = "^2.7.4" -flake8-import-order = "^0.18.1" -nox = "^2020.12.31" - -[tool.poetry.scripts] -ds-utils = "ds_utils.__main__:main" - -[tool.coverage.paths] -source = ["src", "*/site-packages"] - -[tool.coverage.run] -branch = true -source = ["ds_utils"] - -[tool.coverage.report] -show_missing = true -fail_under = 100 - -[build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" diff --git a/src/ds_utils/__init__.py b/src/ds_utils/__init__.py deleted file mode 100644 index b4baae5..0000000 --- a/src/ds_utils/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Nesta Data Science Utilities.""" diff --git a/src/ds_utils/__main__.py b/src/ds_utils/__main__.py deleted file mode 100644 index 7d2ecc1..0000000 --- a/src/ds_utils/__main__.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Command-line interface.""" -import click - - -@click.command() -@click.version_option() -def main() -> None: - """Nesta Data Science Utilities.""" - - -if __name__ == "__main__": - main(prog_name="ds-utils") # pragma: no cover diff --git a/src/ds_utils/py.typed b/src/ds_utils/py.typed deleted file mode 100644 index e69de29..0000000 diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index 06a8978..0000000 --- a/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Test suite for the ds_utils package.""" diff --git a/tests/test_main.py b/tests/test_main.py deleted file mode 100644 index 7473923..0000000 --- a/tests/test_main.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Test cases for the __main__ module.""" -import pytest -from click.testing import CliRunner - -from ds_utils import __main__ - - -@pytest.fixture -def runner() -> CliRunner: - """Fixture for invoking command-line interfaces.""" - return CliRunner() - - -def test_main_succeeds(runner: CliRunner) -> None: - """It exits with a status code of zero.""" - result = runner.invoke(__main__.main) - assert result.exit_code == 0