Skip to content

Commit

Permalink
Added ability to release to PyPI (#21)
Browse files Browse the repository at this point in the history
* Update and rename publish-test.yml to publish.yml

to publish to real PyPI

* Update README.md to rename to dive-EPR

* Update pyproject.toml to rename dive-EPR

* Update conf.py to update version

* Update pyproject.toml to new version 0.2.0

* Update usage.rst to rename to dive-EPR

* Update README.md for clarity
  • Loading branch information
ambivalent-synchronicity committed Aug 13, 2024
1 parent 0655a7d commit 47c801a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name : Publish to TestPyPI
name : Publish to PyPI

on : push

Expand Down Expand Up @@ -28,16 +28,16 @@ jobs:
name: python-package-distributions
path: dist/

publish-to-testpypi:
publish-to-pypi:
name: >-
Publish to TestPyPI
Publish to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/dive-MCMC
name: pypi
url: https://pypi.org/p/dive-EPR
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
Expand All @@ -46,17 +46,15 @@ jobs:
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

github-release:
name: >-
Sign the distribution with Sigstore
and upload them to GitHub Release
needs:
- publish-to-testpypi
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
Expand Down
26 changes: 2 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

### Setup

You can install `dive` using `pip`. Please note that the installation name is `dive-MCMC`.
You can install `dive` using `pip`. Please note that the PyPI package name is `dive-EPR`.

pip install dive-MCMC
pip install dive-EPR

You can also directly clone the `dive` directory. Please make sure to also import the necessary packages.

Expand All @@ -31,28 +31,6 @@ You can also directly clone the `dive` directory. Please make sure to also impor

import dive

<!-- As long as `dive` is in a development state, use the following installation procedure:
If using `conda`, install the following packages to the environment of your choice:
conda install pymc deerlab scipy matplotlib pandas mkl-service h5netcdf pytest
You can also use `pip`.
After successful installation of dependencies, navigate to the directory that contains the `dive` source code and run
python setup.py develop -->

<!-- A pre-built distribution can be installed using `pip`.
First, ensure that `pip` is up-to-date. From a terminal (preferably with admin privileges) use the following command:
python -m pip install --upgrade pip
Next, install dive with
python -m pip install dive -->

### Documentation

See the [documentation](https://stolllab.github.io/dive) for a detailed guide on how to use `dive`. An IPython Notebook guide on using `dive` can also be found under the `examples/` directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
project = 'dive'
copyright = '2024, Sarah Sweger, Julian Cheung, Lukas Zha, Stephan Pribitzer, Stefan Stoll'
author = 'Sarah Sweger, Julian Cheung, Lukas Zha, Stephan Pribitzer, Stefan Stoll'
release = '0.1'
release = '0.2'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
8 changes: 4 additions & 4 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Usage
Installation
------------

To install ``dive``, install it with pip. Please note that the package name is
``dive-MCMC``:
To install ``dive``, install it with pip. Please note that the PyPI package name is
``dive-EPR``:

.. code-block::
pip install dive-MCMC
pip install dive-EPR
To use ``dive``, import it as usual:

Expand Down Expand Up @@ -364,4 +364,4 @@ For the marginal posteriors of the other parameters, you can call
:width: 400

.. image:: images/correlations-2.png
:width: 400
:width: 400
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "dive-MCMC"
version = "0.1.0"
name = "dive-EPR"
version = "0.2.0"
authors = [
{name = "Sarah Sweger"},
{name = "Julian Cheung", email = "julianc2477@gmail.com"},
Expand Down

0 comments on commit 47c801a

Please sign in to comment.