Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
rzyu45 committed May 20, 2024
1 parent ab6a4e8 commit 75e5df3
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 124 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Publish Python 🐍 distribution 📦 to PyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: windows-latest
environment:
name: pypi
url: https://pypi.org/project/Solverz/
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: windows-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ from bounceball import mdl as nbball, y as y0

# Installation

Solverz requires ```python>=3.10```, and can be installed locally with

```shell
pip install Solverz
```

# Useful Resources

- [Solverz Documentation](https://docs.solverz.org)
Expand Down
130 changes: 7 additions & 123 deletions docs/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,130 +2,14 @@

# Installation

The SymPy CAS can be installed on virtually any computer with Python.
SymPy does require [mpmath] Python library to be installed first. The
recommended method of installation is through Anaconda, which includes
mpmath, as well as several other useful libraries. Alternatively, some Linux
distributions have SymPy packages available.
Solverz officially supports Python>=3.10.

SymPy officially supports Python 3.8, 3.9, 3.10, and PyPy.
## Using PIP

## Anaconda
The standard utility for installing Python packages is ``pip``. You
can install Solverz in your system Python installation by executing
the following in a shell:

[Anaconda](https://www.anaconda.com/products/distribution) is a free Python distribution from
Continuum Analytics that includes SymPy, Matplotlib, IPython, NumPy, and many
more useful packages for scientific computing. This is recommended because
many nice features of SymPy are only enabled when certain libraries are
installed. For example, without Matplotlib, only simple text-based plotting
is enabled. With the IPython notebook or qtconsole, you can get nicer
$\mathrm{\LaTeX}$ printing by running `init_printing()`.

If you already have Anaconda and want to update SymPy to the latest version,
use:

```
conda update sympy
```

(installation-git)=
## Git

If you wish to contribute to SymPy or like to get the latest updates as they
come, install SymPy from git. To download the repository, execute the
following from the command line:

```
git clone https://github.com/sympy/sympy.git
```

To update to the latest version, go into your repository and execute:

```
git pull origin master
```

If you want to install SymPy, but still want to use the git version, you can run
from your repository:

```
python -m pip install -e .
```

This will cause the installed version to always point to the version in the git
directory.

## Other Methods

You may also install SymPy using pip or from source. In addition, most Linux
and Python distributions have some SymPy version available to install using
their package manager. Here is a list of several such Python distributions:

- [Anaconda](https://www.anaconda.com/products/distribution)
- [Enthought Deployment Manager](https://assets.enthought.com/downloads/edm/)
- [ActivePython](https://www.activestate.com/products/python/)
- [Spack](https://spack.io/)

## Run SymPy

After installation, it is best to verify that your freshly-installed SymPy
works. To do this, start up Python and import the SymPy libraries:

```
$ python
>>> from sympy import *
```

From here, execute some simple SymPy statements like the ones below:

```
>>> x = Symbol('x')
>>> limit(sin(x)/x, x, 0)
1
>>> integrate(1/x, x)
log(x)
```

For a starter guide on using SymPy effectively, refer to the {ref}`intro-tutorial`.

(mpmath-install)=
## mpmath

Versions of SymPy prior to 1.0 included [mpmath], but it now depends on it as
an external dependency. If you installed SymPy with Anaconda, it will already
include mpmath. Use:

```
conda install mpmath
```shell
pip install Solverz
```

to ensure that it is installed.

If you do not wish to use Anaconda, you can use `pip install mpmath`.

If you use mpmath via `sympy.mpmath` in your code, you will need to change
this to use just `mpmath`. If you depend on code that does this that you
cannot easily change, you can work around it by doing:

```
import sys
import mpmath
sys.modules['sympy.mpmath'] = mpmath
```

before the code that imports `sympy.mpmath`. It is recommended to change
code that uses `sympy.mpmath` to use `mpmath` directly wherever possible.

## Questions

If you have a question about installation or SymPy in general, feel free to
visit our chat on [Gitter]. In addition, our [mailing list] is an excellent
source of community support.

If you think there's a bug or you would like to request a feature, please open
an [issue ticket].

[downloads site]: https://github.com/sympy/sympy/releases
[gitter]: https://gitter.im/sympy/sympy
[issue ticket]: https://github.com/sympy/sympy/issues
[mailing list]: https://groups.google.com/forum/#!forum/sympy
[mpmath]: https://mpmath.org/
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "Solverz"
version = "0.0.1rc2"
dependencies = [
"sympy>=1.11.1",
"numba == 0.58.1",
"numpy>=1.26.3",
"scipy>=1.12.0",
"dill >= 0.3.7",
"pandas>=1.4.2",
"openpyxl>=3.0.10",
"matplotlib>=3.5.2",
"tqdm>=4.64.1",
"pytest>=7.2.2",
"networkx >= 3.1"
]
authors = [
{ name = "Ruizhi Yu", email = "[email protected]" },
]
description = "A simulation modelling language"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/smallbunnies/Solverz"
Issues = "https://github.com/smallbunnies/Solverz/issues"
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pytest>=7.2.2
networkx >= 3.1
numba == 0.58.1
dill >= 0.3.7
jax>=0.4.23

0 comments on commit 75e5df3

Please sign in to comment.