Skip to content

Commit

Permalink
Update README and add github action for building pypi package (#19)
Browse files Browse the repository at this point in the history
* Update README and add github action for building pypi package

* fix README file extension
  • Loading branch information
xgarrido authored May 11, 2023
1 parent 164835f commit 14a851c
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
45 changes: 45 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build wheels and upload to PyPI

on: [push, pull_request]

jobs:

build_dist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.X'

- name: Build sdist and wheel
run: |
python -m pip install wheel
python setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v3
with:
path: dist/*
retention-days: 1

upload_pypi:
needs: [build_dist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/
6 changes: 0 additions & 6 deletions README.md

This file was deleted.

40 changes: 40 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
================
PSpipe utilities
================

Useful functions for ``PSpipe``, the Simons Observatory and ACT CMB power spectrum pipeline.

.. image:: https://img.shields.io/pypi/v/pspipe_utils.svg?style=flat
:target: https://pypi.python.org/pypi/pspipe_utils

.. image:: https://img.shields.io/github/actions/workflow/status/simonsobs/pspipe_utils/testing.yml?branch=main
:target: https://github.com/simonsobs/pspipe_utils/actions

.. image:: https://codecov.io/gh/simonsobs/pspipe_utils/branch/main/graph/badge.svg?token=IVHHH73BI7
:target: https://codecov.io/gh/simonsobs/pspipe_utils


Installing the code
-------------------

The easiest way to install and to use ``pspipe_utils`` likelihood is *via* ``pip``

.. code:: shell
pip install pspipe_utils
If you want to dig into the code, you'd better clone this repository to some location

.. code:: shell
git clone https://github.com/simonsobs/pspipe_utils.git /where/to/clone
Then you can install the ``pspipe_utils`` suite and its dependencies *via*

.. code:: shell
pip install -e /where/to/clone
The ``-e`` option allow the developer to make changes within the ``pspipe_utils`` directory without
having to reinstall at every changes. If you plan to just use the utilities suite and do not develop
it, you can remove the ``-e`` option.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import versioneer

with open("README.md") as readme_file:
with open("README.rst") as readme_file:
readme = readme_file.read()

setup(
Expand All @@ -11,7 +11,7 @@
cmdclass=versioneer.get_cmdclass(),
description="SO pipeline utilities",
long_description=readme,
long_description_content_type="text/markdown",
long_description_content_type="text/x-rst",
packages=find_packages(),
python_requires=">=3.5",
install_requires=[
Expand Down

0 comments on commit 14a851c

Please sign in to comment.