chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
Reporting Issues
|
||||
================
|
||||
|
||||
When opening a new issue, please take the following steps:
|
||||
|
||||
1. Please search `GitHub issues`_ to avoid duplicate reports.
|
||||
|
||||
2. If possible, try updating to master and reproducing your issue.
|
||||
|
||||
3. Try to include a minimal code example that demonstrates the problem.
|
||||
|
||||
4. Include any relevant details of your local setup (mpmath version, Python
|
||||
version, installed libraries).
|
||||
|
||||
Please avoid changing your messages on the GitHub, unless you want fix a typo
|
||||
and so on. Just expand your comment or add a new one.
|
||||
|
||||
|
||||
Contributing Code
|
||||
=================
|
||||
|
||||
All work should be submitted via `Pull Requests (PR)`_.
|
||||
|
||||
1. PR can be submitted as soon as there is code worth discussing.
|
||||
Please make a draft PR, if one is not intended to be merged
|
||||
in its present shape even if all checks pass.
|
||||
|
||||
2. Please put your work on the branch of your fork, not in the
|
||||
master branch. PR should generally be made against master.
|
||||
|
||||
3. One logical change per commit. Make good commit messages: short
|
||||
(<= 78 characters) one-line summary, then newline followed by
|
||||
verbose description of your changes. Please `mention closed
|
||||
issues`_ with commit message.
|
||||
|
||||
4. Please conform to `PEP 8`_; run::
|
||||
|
||||
flake518
|
||||
|
||||
to check formatting.
|
||||
|
||||
5. PR should include tests:
|
||||
|
||||
1. Bugfixes should include regression tests (named as ``test_issue_123``).
|
||||
2. All new functionality should be tested, every new line
|
||||
should be covered by tests. Please use in tests only
|
||||
public interfaces. Regression tests are not accounted in
|
||||
the coverage statistics.
|
||||
3. Optionally, provide doctests to illustrate usage. But keep in
|
||||
mind, doctests are not tests. Think of them as examples that
|
||||
happen to be tested.
|
||||
|
||||
6. It's good idea to be sure that **all** existing tests
|
||||
pass and you don't break anything, so please run::
|
||||
|
||||
pytest
|
||||
|
||||
7. If your change affects documentation, please build it by::
|
||||
|
||||
sphinx-build -W -b html docs build/sphinx/html
|
||||
|
||||
and check that it looks as expected.
|
||||
|
||||
|
||||
AI Generated Code and Communication Policy
|
||||
==========================================
|
||||
|
||||
The person submitting an issue or PR is responsible for its content, regardless
|
||||
of whether AI tools were used in its creation. Generative AI tools can produce
|
||||
output quickly, but discretion, good judgment, and critical thinking are the
|
||||
foundation of all good contributions.
|
||||
|
||||
You must understand and explain the code you submit as well as the existing
|
||||
related code. It is not acceptable to submit a patch that you cannot
|
||||
understand and explain yourself. In explaining your contribution, do not use
|
||||
AI to automatically generate descriptions, as AI rarely communicates such
|
||||
information correctly and concisely.
|
||||
|
||||
Disclosure
|
||||
----------
|
||||
|
||||
If you substantially make use of AI to assist in the development of your patch,
|
||||
you must disclose how it was used and what code in the patch is AI generated.
|
||||
Pull request without such disclosure may be rejected.
|
||||
|
||||
Code Quality
|
||||
------------
|
||||
|
||||
Code generated by AI is very often of low quality. Contributors are expected
|
||||
to submit code that meets our standards (see above). We will reject pull
|
||||
requests that we deem being "AI slop". Do not waste developers time by
|
||||
submitting code that is fully or mostly generated by AI.
|
||||
|
||||
Communication
|
||||
-------------
|
||||
|
||||
When interacting in communication among developers (email list, discussions,
|
||||
issues, pull requests, etc) do not use AI to speak for you, other than for
|
||||
translation or grammar editing.
|
||||
|
||||
|
||||
.. _GitHub issues: https://github.com/mpmath/mpmath/issues
|
||||
.. _Pull Requests (PR): https://github.com/mpmath/mpmath/pulls
|
||||
.. _PEP 8: https://www.python.org/dev/peps/pep-0008/
|
||||
.. _mention closed issues: https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
|
||||
@@ -0,0 +1,11 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
rebase-strategy: "disabled"
|
||||
groups:
|
||||
actions-deps:
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -0,0 +1,45 @@
|
||||
name: Run coverage tests
|
||||
on: [workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
coverage:
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: true
|
||||
env:
|
||||
PYTEST_ADDOPTS: --cov mpmath --cov-append -n auto
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade .[develop,gmpy2,gmp,ci]
|
||||
- name: Run coverage tests
|
||||
run: |
|
||||
pytest
|
||||
pip uninstall -y ipython
|
||||
pytest mpmath/tests/test_cli.py
|
||||
pip uninstall -y gmpy2
|
||||
pytest mpmath/tests/test_basic_ops.py mpmath/tests/test_convert.py \
|
||||
mpmath/tests/test_functions.py mpmath/tests/test_gammazeta.py \
|
||||
mpmath/tests/test_bitwise.py
|
||||
pip uninstall -y python-gmp
|
||||
pytest mpmath/tests/test_basic_ops.py mpmath/tests/test_convert.py \
|
||||
mpmath/tests/test_functions.py mpmath/tests/test_gammazeta.py \
|
||||
mpmath/tests/test_bitwise.py
|
||||
- name: Generate coverage reports
|
||||
run: |
|
||||
coverage xml
|
||||
coverage html
|
||||
diff-cover coverage.xml --fail-under=100 \
|
||||
--compare-branch=origin/master
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: coverage
|
||||
path: |
|
||||
coverage.xml
|
||||
build/coverage/html/
|
||||
@@ -0,0 +1,34 @@
|
||||
name: Build & test docs
|
||||
on: [workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Install libs
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install latexmk texlive-xetex
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade .[docs]
|
||||
- name: Building docs
|
||||
run: |
|
||||
sphinx-build --color -W --keep-going -b html docs build/sphinx/html
|
||||
sphinx-build --color -W --keep-going -b latex docs build/sphinx/latex
|
||||
make -C build/sphinx/latex all-pdf
|
||||
env:
|
||||
NO_COLOR: 1 # workaround for sphinx-contrib/autoprogram#76
|
||||
COLUMNS: 80 # also enable line wrapping for argparse
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: docs
|
||||
path: |
|
||||
build/sphinx/html/
|
||||
build/sphinx/latex/mpmath.pdf
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Linting with flake8, etc
|
||||
on: [workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
linter:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- run: pip install --upgrade .[develop]
|
||||
- run: python -We:invalid -m compileall -f mpmath -q
|
||||
- run: flake518 mpmath
|
||||
@@ -0,0 +1,35 @@
|
||||
name: Publish on PyPI
|
||||
on: [push, workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
build:
|
||||
name: Build distributions
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- run: pip install build
|
||||
- run: python -m build
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: build
|
||||
path: dist/
|
||||
publish-to-pypi:
|
||||
name: Publish distributions to PyPI
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs:
|
||||
- build
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: build
|
||||
path: dist/
|
||||
merge-multiple: true
|
||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
@@ -0,0 +1,64 @@
|
||||
name: test
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * 2'
|
||||
jobs:
|
||||
linter:
|
||||
uses: ./.github/workflows/linter.yml
|
||||
coverage:
|
||||
uses: ./.github/workflows/coverage.yml
|
||||
docs:
|
||||
uses: ./.github/workflows/docs.yml
|
||||
frozen-version:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Run frozen version test
|
||||
run: ./mpmath/tests/test_version_frozen.sh
|
||||
tests:
|
||||
needs:
|
||||
- linter
|
||||
- coverage
|
||||
- frozen-version
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.10', 3.11, 3.12, 3.13, 3.14, 3.14t, 3.15, 3.15t]
|
||||
nogmpy: [false]
|
||||
purepy: [false]
|
||||
include:
|
||||
- python-version: "3.x"
|
||||
nogmpy: true
|
||||
- python-version: "3.x"
|
||||
purepy: true
|
||||
- python-version: pypy3.11
|
||||
purepy: true
|
||||
env:
|
||||
PYTEST_ADDOPTS: -n auto --durations=20
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
allow-prereleases: true
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade .[develop,gmpy2,gmp,ci]
|
||||
- run: pip uninstall -y gmpy2
|
||||
if: matrix.nogmpy
|
||||
- run: pip uninstall -y gmpy2 python-gmp
|
||||
if: matrix.purepy
|
||||
- run: pytest
|
||||
Reference in New Issue
Block a user