diff --git a/.auto-changelog b/.auto-changelog index 350a120..47c382e 100644 --- a/.auto-changelog +++ b/.auto-changelog @@ -1,12 +1,11 @@ { "output": "CHANGELOG.md", "template": ".auto-changelog-template.hbs", - "tagPrefix": "bluepyparallel-v", "commitLimit": false, "backfillLimit": false, - "ignoreCommitPattern": "^Release:? [0-9]+\\.[0-9]+\\.[0-9]+$|^Update CHANGELOG.*|.*\\[skip-changelog\\].*|^\\[pre-commit.ci\\]|^\\(dependabot\\) .*", - "commitUrl": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel/commit/{id}", - "issueUrl": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel/issues/{id}", - "mergeUrl": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel/merge_requests/{id}", - "compareUrl": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel/compare/{from}...{to}" + "ignoreCommitPattern": "^Release:? [0-9]+\\.[0-9]+\\.[0-9]+( ?\\(#[0-9]+\\))?$|^Update CHANGELOG.*|.*\\[skip-changelog\\].*|^\\[pre-commit.ci\\]|^\\(dependabot\\) .*", + "commitUrl": "https://github.com/BlueBrain/BluePyParallel/commit/{id}", + "issueUrl": "https://github.com/BlueBrain/BluePyParallel/issues/{id}", + "mergeUrl": "https://github.com/BlueBrain/BluePyParallel/pull/{id}", + "compareUrl": "https://github.com/BlueBrain/BluePyParallel/compare/{from}..{to}" } diff --git a/.auto-changelog-template.hbs b/.auto-changelog-template.hbs index 60d2ab9..2906c87 100644 --- a/.auto-changelog-template.hbs +++ b/.auto-changelog-template.hbs @@ -136,7 +136,7 @@ Example Definitions - {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}) {{/commit-list}} - {{#commit-list merges heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[dD]eprecate:|^[dD]eprecate\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}} + {{#commit-list merges heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild ?\(|^[dD]eprecate:|^[dD]eprecate ?\(|^[fF]eat:|^[fF]eat ?\(|^[fF]ix:|^[fF]ix ?\(|^[cC]hore:|^[cC]hore ?\(|^[cC][iI]:|^[cC][iI] ?\(|^[dD]ocs:|^[dD]ocs ?\(|^[rR]efactor:|^[rR]efactor ?\(|^[tT]est:|^[tT]est ?\(|^[sS]tyle:|^[sS]tyle ?\(|^[pP]erf:|^[pP]erf ?\(|\[skip-changelog\]'}} - {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}) {{/commit-list}} @@ -190,7 +190,7 @@ Example Definitions - {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}}) {{/commit-list}} - {{#commit-list commits heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[dD]eprecate:|^[dD]eprecate\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}} + {{#commit-list commits heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild ?\(|^[dD]eprecate:|^[dD]eprecate ?\(|^[fF]eat:|^[fF]eat ?\(|^[fF]ix:|^[fF]ix ?\(|^[cC]hore:|^[cC]hore ?\(|^[cC][iI]:|^[cC][iI] ?\(|^[dD]ocs:|^[dD]ocs ?\(|^[rR]efactor:|^[rR]efactor ?\(|^[tT]est:|^[tT]est ?\(|^[sS]tyle:|^[sS]tyle ?\(|^[pP]erf:|^[pP]erf ?\(|\[skip-changelog\]'}} - {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}}) {{/commit-list}} diff --git a/.codespellrc b/.codespellrc index 89b49a9..4ee856e 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,2 @@ [codespell] skip = .git/* -ignore-regex = @groupes.epfl.ch diff --git a/.copier-answers.yml b/.copier-answers.yml index 6b2df17..67a876e 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,27 +1,25 @@ # Changes here will be overwritten by Copier -_commit: 0.1.52 +_commit: 0.1.55 _src_path: git@bbpgitlab.epfl.ch:neuromath/python-template.git -author_email: bbp-ou-cells@groupes.epfl.ch -author_name: bbp-ou-cells -copyright_license: BBP-internal-confidential -copyright_year: '2022' -distribution_name: bluepyparallel -download_url: https://bbpgitlab.epfl.ch/neuromath/bluepyparallel +author_name: Blue Brain Project, EPFL +copyright_license: Apache License 2.0 +copyright_year: '2024' +distribution_name: BluePyParallel +download_url: https://github.com/BlueBrain/BluePyParallel init_git: false maintainer: Adrien Berchet package_name: bluepyparallel -project_description: Provides an embarassingly parallel tool with sql backend. +project_description: Provides an embarrassingly parallel tool with sql backend. project_name: BluePyParallel -project_url: https://bbpteam.epfl.ch/documentation/projects/bluepyparallel -repository_name: bluepyparallel -repository_namespace: neuromath -repository_provider: gitlab +project_url: https://BluePyParallel.readthedocs.io +repository_name: BluePyParallel +repository_namespace: BlueBrain +repository_provider: github setup_codeql: false -ssh_url: git@bbpgitlab.epfl.ch:neuromath/bluepyparallel.git -team_name: neuromath -tracker_url: https://bbpteam.epfl.ch/project/issues/projects/CELLS/issues -use_pyproject_toml: false +ssh_url: git@github.com:BlueBrain/BluePyParallel.git +tracker_url: https://github.com/BlueBrain/BluePyParallel/issues +use_pyproject_toml: true version: 0.0.9.dev0 # End of Copier answers diff --git a/.coveragerc b/.coveragerc index 48e3344..c6d4962 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,4 +3,4 @@ source_paths = bluepyparallel */site-packages/bluepyparallel */bluepyparallel/bluepyparallel - */bluepyparallel/bluepyparallel + */BluePyParallel/bluepyparallel diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..2e3cee3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,114 @@ +# docs https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema + +name: Create a bug report regarding BluePyParallel runtime behavior +description: Errors and regression reports with complete reproducing test cases and/or stack traces. +labels: [bug] +title: "[Bug report] " +body: + - type: markdown + attributes: + value: " +Thanks for taking the time to fill out this bug report! + + +Before submitting, make sure you search in the [issue list](https://github.com/BlueBrain/BluePyParallel/issues) that a similar issue was not already reported. +If it is not the case, please read the following guidelines. + +### GUIDELINES FOR REPORTING BUGS + +Bug reports that are not properly formulated and formatted or without enough details can be very hard for us to understand and fix. +In order to ensure we can help you fixing your bug, please follow these guidelines. + + +Your reports must include the following features: + +1. **succinct description** of the problem - typically a line or two at most. + +2. **succinct, dependency-free code** which reproduces the problem, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example. + IF YOU DO NOT HAVE A COMPLETE, RUNNABLE TEST CASE WRITTEN DIRECTLY IN THE TEXTAREA BELOW, YOUR ISSUE MAY BE CLOSED. + +3. **complete stack traces for all errors** - please avoid screenshots, use formatted text inside issues. + +4. other relevant things as applicable: **dependencies**, **comparative performance timings** for performance issues, etc. +" + + - type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: input + id: relevant_documentation + attributes: + label: Optional link from https://BluePyParallel.readthedocs.io which documents the behavior that is expected + description: " +Please make sure the behavior you are seeing is definitely in contradiction to what's documented as the correct behavior. +" + validations: + required: false + + - type: textarea + attributes: + label: To Reproduce + description: " +Provide your [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example here." + placeholder: "# Insert code here (text area already python formatted)" + render: Python + validations: + required: true + + - type: textarea + attributes: + label: Error + description: " +Provide the complete text of any errors received **including the complete stack trace**. +If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py`` +" + placeholder: "# Copy the complete stack trace and error message here (text area already formatted for Python backtrace)" + render: Python traceback + validations: + required: true + + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. + validations: + required: false + + - type: input + id: package_version + attributes: + label: bluepyparallel Version in Use + description: e.g. 1.4.42, 2.0.2, etc or commit hash + validations: + required: true + + - type: input + id: python_version + attributes: + label: Python Version + description: Assumes cpython unless otherwise stated, e.g. 3.10, 3.11, pypy + validations: + required: true + + - type: dropdown + id: os + attributes: + label: Operating system + description: Check all that apply + multiple: true + options: + - Linux + - MacOS + - Windows + - Other + validations: + required: true + + - type: markdown + attributes: + value: "### Thanks! Have a nice day!" diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..0086358 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000..7cdbbc7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,56 @@ +# docs https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema + +name: Request a new use case +description: Support for new features +labels: [enhancement] +title: "[Feature request] " +body: + - type: markdown + attributes: + value: " +Thanks for taking the time to fill out this feature request! + + +Before submitting, make sure the feature does not already exist in the [documentation](https://BluePyParallel.readthedocs.io) and that you searched in the [issue list](https://github.com/BlueBrain/BluePyParallel/issues) that a similar feature request has not already been reported. +If it is not the case, please read the following guidelines. + +### GUIDELINES FOR REQUESTING HELP + +Feature requests that are not properly formulated and formatted or without enough details can be very hard for us to understand. +In order to ensure we can help you, please follow these guidelines. + + +Your requests must include the following features: + +1. **succinct description** of the feature - typically a line or two at most to describe what the new feature would do. + +2. **succinct, dependency-free code** which shows how you would like to use this feature, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example. + +3. Why do you need this feature? What would be the use cases? +" + + - type: textarea + attributes: + label: Describe the feature + description: A clear and concise description of what the feature would consist in. + validations: + required: true + + - type: textarea + attributes: + label: Example Use + description: Provide a clear example of what the usage of this feature would look like. + validations: + required: true + + - type: textarea + attributes: + label: Use cases + description: Add as much information as possible about the use cases here. + validations: + required: true + + - type: markdown + attributes: + value: "### Thanks! Have a nice day!" diff --git a/.github/ISSUE_TEMPLATE/how_to_use.yaml b/.github/ISSUE_TEMPLATE/how_to_use.yaml new file mode 100644 index 0000000..e3fcf1a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/how_to_use.yaml @@ -0,0 +1,91 @@ +# docs https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema + +name: Ask for help about BluePyParallel +description: Questions about bluepyparallel features. +labels: [how to use] +title: "[How to use] " +body: + - type: markdown + attributes: + value: " +Thanks for using this package and taking the time to fill out this help request! + + +Before submitting, make sure you read the [documentation](https://BluePyParallel.readthedocs.io) carefully. +If you still have a question, you should search in the [issue list](https://github.com/BlueBrain/BluePyParallel/issues) that a similar issue has not already been reported, you might find your answer there. +If it is not the case, please read the following guidelines. + +### GUIDELINES FOR REQUESTING HELP + +Questions that are not properly formulated and formatted or without enough details can be very hard for us to understand. +In order to ensure we can help you, please follow these guidelines. + + +Your requests must include the following features: + +1. **succinct description** of the problem - typically a line or two at most to describe what you want to achieve. + +2. **succinct, dependency-free code** which shows what you tried to do, otherwise known as a [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve). + +3. **expected results** + +4. **complete stack traces for all errors** if you have any - please avoid screenshots, use formatted text inside issues. + +5. other relevant things: **dependencies**, **operating system**, **comparative performance timings** for performance issues. +" + + - type: textarea + attributes: + label: Describe the problem + description: A clear and concise description of what you want to achieve. + validations: + required: true + + - type: textarea + attributes: + label: Show what you tried to do. + description: " +Provide your [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve) here." + placeholder: "# Insert code here (text area already python formatted)" + render: Python + validations: + required: true + + - type: textarea + attributes: + label: Describe what you expected. + description: A clear and concise description of what you which result you expected by doing this. + validations: + required: true + + - type: textarea + attributes: + label: Error + description: " +If you are facing an arror, provide the complete text of any errors received **including the complete stack trace**. +If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py`` +" + placeholder: "# Copy the complete stack trace and error message here (text area already formatted for Python backtrace)" + render: Python traceback + validations: + required: false + + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. + validations: + required: false + + - type: input + id: package_version + attributes: + label: bluepyparallel Version in Use + description: e.g. 1.4.42, 2.0.2, etc or commit hash + validations: + required: true + + - type: markdown + attributes: + value: "### Thanks! Have a nice day!" diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a6aa10a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # See: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: "github-actions" + directory: "/" # Check the repository's workflows under /.github/workflows/ + schedule: + interval: "weekly" + commit-message: + # Prefix all commit messages with "CI(dependabot): " + prefix: "CI(dependabot): " diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..a3728e0 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ + + + +### Description + + +### Checklist + + +This pull request is: + +- [ ] A documentation / typographical error fix + - Good to go, no issue or tests are needed +- [ ] A short code fix + - [ ] Please include: `Fixes: #` in the description if it solves an existing issue + (which must include a complete example of the issue). + - [ ] Please include tests that fail with the `main` branch and pass with the provided fix. +- [ ] A new feature implementation or update an existing feature + - [ ] Please include: `Fixes: #` in the description if it solves an existing issue + (which must include a complete example of the feature). + - [ ] Please include tests that cover every lines of the new/updated feature. + - [ ] Please update the documentation to describe the new/updated feature. + + diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..0adb8fc --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,19 @@ +name: Check PR titles using commitlint + +on: + pull_request: + types: [edited, opened, reopened, synchronize] + +jobs: + check-pr-title: + name: Check PR title + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - run: npm install -g --force commitlint @commitlint/cli commitlint-plugin-cleanfeet + - run: npm install conventional-changelog-conventionalcommits + - run: touch .git/COMMIT_EDITMSG + - run: echo "${{ github.event.pull_request.title }}" | commitlint diff --git a/.github/workflows/publish-sdist.yml b/.github/workflows/publish-sdist.yml new file mode 100644 index 0000000..85abdf9 --- /dev/null +++ b/.github/workflows/publish-sdist.yml @@ -0,0 +1,25 @@ +name: Publish sdist tarball to PyPi + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +jobs: + build-n-publish: + name: Build and publish on PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Build a wheel and a source tarball + run: | + pip install setuptools>=42 build setuptools_scm[toml]>=3.4 + python -m build -o dist + - name: Publish distribution package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/run-tox.yml b/.github/workflows/run-tox.yml new file mode 100644 index 0000000..a22e09b --- /dev/null +++ b/.github/workflows/run-tox.yml @@ -0,0 +1,79 @@ +name: Run all tox jobs using Python3 + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + min_versions: ["min_versions", "latest_versions"] + exclude: + - min_versions: "min_versions" + include: + - python-version: "3.8" + min_versions: "min_versions" + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Get current month + id: date + run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT + - name: Install MPI + run: sudo apt-get install libopenmpi-dev + - name: Cache tox and precommit environments + uses: actions/cache@v4 + with: + path: | + .tox + ~/.cache/pre-commit + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }}-${{ hashFiles('setup.py') }}-${{ hashFiles('.pre-commit-config.yaml') }} + - name: Clear results in tox environments + run: | + rm -rf .tox/*/tmp + - name: Run tox with latest versions + if: ${{ matrix.min_versions == 'latest_versions' }} + run: | + python -m pip install --upgrade pip setuptools + pip install tox-gh-actions + tox + - name: Run tox with min versions + if: ${{ matrix.min_versions == 'min_versions' }} + run: | + python -m pip install --upgrade pip setuptools + pip install tox + tox run -e min_versions + - name: JUnit Report Action + uses: mikepenz/action-junit-report@v4 + if: always() # always run even if the previous step fails + with: + report_paths: 'reports/pytest-*.xml' + - name: Upload to codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: false + directory: ./reports + flags: pytest + name: "BluePyParallel-py${{ matrix.python-version }}-${{ matrix.min_versions }}" + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload test artifacts + uses: actions/upload-artifact@v4 + if: always() + with: + name: tests-${{ matrix.python-version }}-${{ matrix.min_versions }} + retention-days: 4 + path: | + .tox/py*/tmp + docs/build + reports diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 986d570..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,29 +0,0 @@ -include: - - project: nse/ci - file: - - /ci/lib/tox-bb5.yml - - /ci/jobs/check-version.yml - - /ci/jobs/check-packaging.yml - - /ci/jobs/lint.yml - - /ci/jobs/docs.yml - - /ci/jobs/build-package.yml - - /ci/jobs/publish-package.yml - - /ci/jobs/publish-docs.yml - - /ci/jobs/tag.yml - - project: neuromath/ci - file: - - /ci/jobs/auto-release.yml - - /ci/jobs/check-merge-request-title.yml - - /ci/lib/pytest-template.yml - - /ci/jobs/py38.yml - - /ci/jobs/py39.yml - - /ci/jobs/py310.yml - - /ci/jobs/min_versions.yml - - /ci/jobs/coverage.yml - -.tox-template: - variables: - EXTRA_MODULES: - archive/2024-01:py-mpi4py - bb5_cpus_per_task: 8 - bb5_memory: 6G diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..c51d15e --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,22 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + os: ubuntu-20.04 + tools: + python: "3.9" + +sphinx: + configuration: docs/source/conf.py + fail_on_warning: true + +python: + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..63e05b8 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,7 @@ +# Maintainer + +Adrien Berchet (@adrien-berchet) + +# Contributors + +* Alexis Arnaudon (@arnaudon) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fff4259 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,170 @@ +# Contributing + +We would love for you to contribute to this package and help make it even better than it is today! +As a contributor, here are the guidelines we would like you to follow: +* [Issues and Bugs](#issue) +* [Feature Requests](#feature) +* [Submission Guidelines](#submit) + +## Got a question or found a bug? + +If you have a question or find a bug in the source code, you can help us by +[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can +[submit a Pull Request](#submit-pr) with a fix. + +## Missing a Feature? + +You can *request* a new feature by [submitting an issue](#submit-issue) to our +[GitHub Repository][github]. If you would like to *implement* a new feature, please submit an +issue with a proposal for your work first, to be sure that we can use it. Then +[submit a Pull Request](#submit-pr) that points to this issue. + +Please consider what kind of change it is: +* For a **Major Feature**, first open an issue and outline your proposal so that it can be +discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, +and help you to craft the change so that it is successfully accepted into the project. +* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). + +## Submission Guidelines + +### Submitting an Issue + +Before you submit an issue, please search the issue tracker, maybe an issue for your problem +already exists and the discussion might inform you of workarounds readily available. + +We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce +and confirm it. In order to reproduce bugs we will need as much information as possible, a +[Minimal Working Example](https://stackoverflow.com/help/minimal-reproducible-example), and +preferably be in touch with you to gather information. + +### Submitting a Pull Request (PR) + +When you wish to contribute to the code base, please consider the following guidelines: +* Make a [fork](https://guides.github.com/activities/forking/) of this repository. +* Make your changes in your fork, in a new git branch: + + ```shell + git checkout -b my-fix-branch main + ``` + +* Create your patch, **including appropriate test cases** (please note that the coverage must + always be equal to 100%). +* Run the full test suite, and ensure that all tests pass (at least with one of the required + python interpreters): + + ```shell + tox + ``` + + or + + ```shell + tox -e py38 -e lint -e docs -e check-packaging + ``` + +* Commit your changes using a descriptive commit message. + + ```shell + git commit -a + ``` + + Note: the optional commit `-a` command line option will automatically **add** and **rm** edited + files. +* Push your branch to GitHub: + + ```shell + git push --set-upstream origin my-fix-branch + ``` + +* In GitHub, send a Pull Request to the `main` branch of the upstream repository of the relevant + component. +* If we suggest changes then: + * Make the required updates. + * Re-run the test suites to ensure tests are still passing. + * Rebase your branch and force push to your GitHub repository (this will update your Pull + Request): + + ```shell + git rebase main -i + git push -f + ``` + +That's it! Thank you for your contribution! + +#### After your pull request is merged + +After your pull request is merged, you can safely delete your branch and pull the changes from the +main (upstream) repository: +* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: + + ```shell + git push origin --delete my-fix-branch + ``` + +* Check out the main branch: + + ```shell + git checkout main + ``` + +* Delete the local branch: + + ```shell + git branch -D my-fix-branch + ``` + +* Update your main with the latest upstream version: + + ```shell + git pull --ff upstream main + ``` + +### Releasing a new version + +Releasing a new version can only be done by the maintainers. + +The release process is the following: +* Checkout the main branch and ensure your local version is up to date: + + ```shell + git checkout main + git pull + ``` + +* Create a new branch locally: + + ```shell + git checkout -b release_X.Y.Z + ``` + +* Update the CHANGELOG file using auto-changelog (see https://www.npmjs.com/package/auto-changelog): + + ```shell + auto-changelog -v X.Y.Z + ``` + +* Commit and push the new changelog: + + ```shell + git commit -m "Release X.Y.Z" + git push --set-upstream origin release_X.Y.Z + ``` + +* Open a new pull request from this branch and merge it. +* Create a new release on GitHub. +* Checkout the main branch and update it: + + ```shell + git checkout main + git pull + ``` + +* Remove your local branch: + + ```shell + git branch -D release_X.Y.Z + ``` + +After these steps the CI should automatically build the wheel and push it to pypi. + +[github]: https://github.com/BlueBrain/BluePyParallel diff --git a/LICENSE.txt b/LICENSE.txt index 3d181f2..60cdb29 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,2 +1,201 @@ - Blue Brain Project Internal License - Copyright 2022 Blue Brain Project, EPFL, all rights reserved + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Blue Brain Project, EPFL + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 67ccd1f..fd677ba 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,14 @@ export PARALLEL_BATCH_SIZE=1000 srun -v ``` + + +## Funding & Acknowledgment + +The development of this software was supported by funding to the Blue Brain Project, a research +center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH +Board of the Swiss Federal Institutes of Technology. + +For license and authors, see `LICENSE.txt` and `AUTHORS.md` respectively. + +Copyright © 2023-2024 Blue Brain Project/EPFL diff --git a/bluepyparallel/__init__.py b/bluepyparallel/__init__.py index 2f6e670..d079795 100644 --- a/bluepyparallel/__init__.py +++ b/bluepyparallel/__init__.py @@ -1,7 +1,25 @@ -"""bluepyparallel package. +"""BluePyParallel package. Provides an embarrassingly parallel tool with sql backend. """ + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import importlib.metadata + from bluepyparallel.evaluator import evaluate # noqa from bluepyparallel.parallel import init_parallel_factory # noqa -from bluepyparallel.version import VERSION as __version__ # noqa + +__version__ = importlib.metadata.version("BluePyParallel") diff --git a/bluepyparallel/database.py b/bluepyparallel/database.py index 9da45da..9477f24 100644 --- a/bluepyparallel/database.py +++ b/bluepyparallel/database.py @@ -1,4 +1,19 @@ """Module used to provide a simple API to a database in which the results are stored.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import re import pandas as pd diff --git a/bluepyparallel/evaluator.py b/bluepyparallel/evaluator.py index 583354d..49388a8 100644 --- a/bluepyparallel/evaluator.py +++ b/bluepyparallel/evaluator.py @@ -1,5 +1,19 @@ """Module to evaluate generic functions on rows of dataframe.""" +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import logging import sys import traceback diff --git a/bluepyparallel/parallel.py b/bluepyparallel/parallel.py index 20395ae..20d3676 100644 --- a/bluepyparallel/parallel.py +++ b/bluepyparallel/parallel.py @@ -1,4 +1,19 @@ """Parallel helper.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import importlib.metadata import json import logging diff --git a/bluepyparallel/utils.py b/bluepyparallel/utils.py index 651f8b3..f7fc675 100644 --- a/bluepyparallel/utils.py +++ b/bluepyparallel/utils.py @@ -1,5 +1,19 @@ """Some utils for the BluePyParallel package.""" +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + def replace_values_in_docstring(**kwargs): """Decorator to replace keywords in docstrings by the actual value of a variable. diff --git a/bluepyparallel/version.py b/bluepyparallel/version.py deleted file mode 100644 index 04b2d35..0000000 --- a/bluepyparallel/version.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version of the bluepyparallel package.""" - -VERSION = "0.2.1.dev0" # pragma: no cover diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..2570b01 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,4 @@ +comment: + layout: "diff, flags, files" + behavior: default + require_changes: true diff --git a/docs/source/conf.py b/docs/source/conf.py index b59d227..e5d275b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,20 @@ """Configuration file for the Sphinx documentation builder.""" +# Copyright 2012-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + # 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 @@ -17,7 +32,7 @@ project = "BluePyParallel" # The short X.Y version -version = metadata.version("bluepyparallel") +version = metadata.version("BluePyParallel") # The full version, including alpha/beta/rc tags release = version @@ -61,7 +76,7 @@ # html_static_path = ['_static'] html_theme_options = { - "metadata_distribution": "bluepyparallel", + "metadata_distribution": "BluePyParallel", } html_title = project diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst new file mode 100644 index 0000000..f2c987c --- /dev/null +++ b/docs/source/contributing.rst @@ -0,0 +1 @@ +.. mdinclude:: ../../CONTRIBUTING.md diff --git a/docs/source/index.rst b/docs/source/index.rst index d80e4f9..3e4a2f3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,3 +8,4 @@ Home api_ref changelog + contributing diff --git a/examples/large_computation.py b/examples/large_computation.py index b3a5cae..733ffef 100644 --- a/examples/large_computation.py +++ b/examples/large_computation.py @@ -1,4 +1,19 @@ """Example of large computation using BluePyParallel.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import sys import time diff --git a/package.json b/package.json index e7adca0..54cc7ce 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "bluepyparallel", + "name": "BluePyParallel", "auto-changelog": { "replaceText": { "([bB]reaking: ?)": "", diff --git a/pyproject.toml b/pyproject.toml index 67f6ae7..68c1cc9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,69 @@ +[project] +name = "BluePyParallel" +authors = [ + { name="Blue Brain Project, EPFL" } +] +description = "Provides an embarrassingly parallel tool with sql backend." +readme = "README.md" +requires-python = ">=3.8" +license = { text = "Apache License 2.0" } +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering :: Bio-Informatics", +] +dynamic = ["version"] +dependencies = [ + "pandas>=1.3", + "ipyparallel>=6.3", + "dask[dataframe, distributed]>=2021.11", + "dask-mpi>=2021.11", + "distributed>=2021.11", + "packaging>=20", + "sqlalchemy>=1.4.24", + "sqlalchemy<2; python_version<'3.8'", + "sqlalchemy-utils>=0.37.2", + "tqdm>=3.7", +] + +[project.optional-dependencies] +docs = [ + "m2r2", + "sphinx", + "sphinx-bluebrain-theme", +] +test = [ + "mpi4py>=3.0.1", + "packaging>=20", + "pytest>=6.1", + "pytest-benchmark>=3.4", + "pytest-cov>=3", + "pytest-html>=3.1", +] + +[project.urls] +Homepage = "https://BluePyParallel.readthedocs.io" +Repository = "https://github.com/BlueBrain/BluePyParallel" +Tracker = "https://github.com/BlueBrain/BluePyParallel/issues" + [build-system] requires = [ "setuptools>=45", + "setuptools_scm[toml]>=6.2", ] build-backend = "setuptools.build_meta" +[tool.setuptools_scm] + +[tool.setuptools.packages.find] +include = ["bluepyparallel*"] [tool.black] line-length = 100 diff --git a/setup.py b/setup.py index d406be6..bf3210b 100644 --- a/setup.py +++ b/setup.py @@ -1,77 +1,20 @@ -"""Setup for the bluepyparallel package.""" -import importlib.util -from pathlib import Path +"""Setup for the BluePyParallel package.""" -from setuptools import find_namespace_packages -from setuptools import setup +# Copyright 2021-2024 Blue Brain Project / EPFL -spec = importlib.util.spec_from_file_location( - "bluepyparallel.version", - "bluepyparallel/version.py", -) -module = importlib.util.module_from_spec(spec) -spec.loader.exec_module(module) -VERSION = module.VERSION +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at -reqs = [ - "pandas>=1.3", - "ipyparallel>=6.3", - "dask[dataframe, distributed]>=2021.11", - "dask-mpi>=2021.11", - "distributed>=2021.11", - "packaging>=20", - "sqlalchemy>=1.4.24", - "sqlalchemy<2; python_version<'3.8'", - "sqlalchemy-utils>=0.37.2", - "tqdm>=3.7", -] +# http://www.apache.org/licenses/LICENSE-2.0 -doc_reqs = [ - "m2r2", - "sphinx", - "sphinx-bluebrain-theme", -] +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -test_reqs = [ - "mpi4py>=3.0.1", - "packaging>=20", - "pytest>=6.1", - "pytest-benchmark>=3.4", - "pytest-cov>=3", - "pytest-html>=3.1", -] +from setuptools import setup -setup( - name="bluepyparallel", - author="bbp-ou-cells", - author_email="bbp-ou-cells@groupes.epfl.ch", - description="Provides an embarrassingly parallel tool with sql backend.", - long_description=Path("README.md").read_text(encoding="utf-8"), - long_description_content_type="text/markdown", - url="https://bbpteam.epfl.ch/documentation/projects/bluepyparallel", - project_urls={ - "Tracker": "https://bbpteam.epfl.ch/project/issues/projects/CELLS/issues", - "Source": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel", - }, - license="BBP-internal-confidential", - packages=find_namespace_packages(include=["bluepyparallel*"]), - python_requires=">=3.8", - version=VERSION, - install_requires=reqs, - extras_require={ - "docs": doc_reqs, - "test": test_reqs, - }, - include_package_data=True, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering :: Bio-Informatics", - ], -) +if __name__ == "__main__": + setup() diff --git a/tests/__init__.py b/tests/__init__.py index ab4664a..266180e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1,15 @@ -"""Tests suite for the bluepyparallel package.""" +"""Tests suite for the BluePyParallel package.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/conftest.py b/tests/conftest.py index 72cbd17..d83c3bb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,19 @@ """Configuration for the pytest test suite.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # pylint: disable=redefined-outer-name import copy import os diff --git a/tests/test_database.py b/tests/test_database.py index a850c16..64f63d9 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -1,4 +1,19 @@ """Test the ``bluepyparallel.evaluator`` module.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # pylint: disable=missing-function-docstring # pylint: disable=redefined-outer-name import os diff --git a/tests/test_evaluator.py b/tests/test_evaluator.py index f330660..fa96584 100644 --- a/tests/test_evaluator.py +++ b/tests/test_evaluator.py @@ -1,4 +1,19 @@ """Test the ``bluepyparallel.evaluator`` module.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # pylint: disable=missing-function-docstring # pylint: disable=redefined-outer-name import time diff --git a/tests/test_parallel.py b/tests/test_parallel.py index 7531469..5a2a8de 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -1,4 +1,19 @@ """Test the ``bluepyparallel.parallel`` module.""" + +# Copyright 2021-2024 Blue Brain Project / EPFL + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # pylint: disable=missing-function-docstring # pylint: disable=redefined-outer-name import importlib.metadata diff --git a/tox.ini b/tox.ini index 4d2d83b..37d25ac 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ files = {[base]name} tests docs/source/conf.py setup.py [tox] envlist = - check-version check-packaging lint docs @@ -20,8 +19,6 @@ allowlist_externals = extras = test setenv = COVERAGE_FILE = {env:COVERAGE_FILE:.coverage-{envname}} - PIP_INDEX_URL = {env:PIP_INDEX_URL:https://bbpteam.epfl.ch/repository/devpi/simple} - PIP_EXTRA_INDEX_URL = {env:PIP_EXTRA_INDEX_URL:https://pypi.python.org/simple} deps = min_versions: Requirements-Builder commands_pre = @@ -60,15 +57,6 @@ commands = coverage xml coverage report -[testenv:check-version] -skip_install = true -deps = bbp-nse-ci>=0.2.5 -commands = - do_release.py -p . check-version - do_release.py -p . check-changelog --release-only --path CHANGELOG.md -commands_pre = -commands_post = - [testenv:check-packaging] skip_install = true deps = @@ -95,7 +83,7 @@ commands_pre = commands_post = [testenv:format] -basepython = python3 +basepython = python3.8 skip_install = true deps = codespell @@ -107,6 +95,7 @@ commands_pre = commands_post = [testenv:docs] +basepython = python3.9 changedir = docs extras = docs allowlist_externals = @@ -115,3 +104,10 @@ allowlist_externals = commands = make html SPHINXOPTS=-W commands_pre = commands_post = + +[gh-actions] +python = + 3.8: py38, lint + 3.9: py39, docs + 3.10: py310, check-packaging + 3.11: py311