Skip to content

Commit fb8d6c0

Browse files
register on PyPI
1 parent ef5845c commit fb8d6c0

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# project
22
cmake_minimum_required(VERSION 3.13.0)
3-
project(hybrid_programming VERSION "0.0.2")
3+
project(hybrid_programming)
44
set(CMAKE_CXX_STANDARD 17)
55

66
if(SKBUILD)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
[![Build Status](https://github.com/YaozhenghangMa/hybrid_programming/actions/workflows/CI.yml/badge.svg?branch=)](https://github.com/YaozhenghangMa/hybrid_programming/actions/workflows/CI.yml?query=branch%3A)
44
[![Coverage](https://codecov.io/gh/YaozhenghangMa/hybrid_programming/branch/main/graph/badge.svg)](https://codecov.io/gh/YaozhenghangMa/hybrid_programming)
5-
[![PyPI](https://img.shields.io/pypi/v/hybrid_programming)](https://pypi.org/project/hybrid_programming/)
5+
[![PyPI](https://img.shields.io/pypi/v/hybrid_example)](https://pypi.org/project/hybrid_example/)
6+
[![Documentation Status](https://readthedocs.org/projects/hybrid-programming/badge/?version=latest)](https://hybrid-programming.readthedocs.io/en/latest/?badge=latest)
67
![License](https://img.shields.io/github/license/yaozhenghangma/hybrid_programming)
78

89
This package aims to offer tutorials on hybrid programming using C++ and Python. The tutorials cover the following topics:

docs/source/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Multiprocessing via [mpi4py](https://github.com/mpi4py/mpi4py)
88
* Continuous integration with [Github Actions](https://github.com/features/actions)
99
* Testing with [pytest](https://docs.pytest.org/en/7.3.x/)
10-
* Register package on [pypi](https://pypi.org)
10+
* Register package on [PyPI](https://pypi.org)
1111
* Publish documents on [Read the Docs](https://readthedocs.org)
1212

1313
## Contents
@@ -17,5 +17,6 @@
1717
vscode
1818
scbuild
1919
github_actions
20+
pypi
2021
api
2122
```

docs/source/pypi.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Register Package on PyPI
2+
In this section, we will provide a concise tutorial about registering Python package on PyPI. Before registering the package, it's necessary to create an account on PyPI, and obtain an [API token](https://pypi.org/help/#apitoken). The API token should be added to Github repository as a secret named `PYPI_API_TOKEN`.
3+
4+
Subsequently, we can register package when publishing a release with the aid of Github actions. An [example action](https://github.com/yaozhenghangma/hybrid_programming/blob/main/.github/workflows/python-publish.yml) can be found in this repository. In the provided example, the action first packages the code with Scikit-Build, and then conducts a building test with pytest. If the test passes successfully, the action `gh-action-pypi-publish` will take charge of publishing the release to PyPI.

docs/source/scbuild.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ from skbuild import setup
99
An example of `setup.py` can be found [here](https://github.com/yaozhenghangma/hybrid_programming/blob/main/setup.py). The additional options in `setup.py` are listed on [Scikit-Build's website](https://scikit-build.readthedocs.io/en/latest/usage.html#setup-options) and [Python's document](https://docs.python.org/3/distutils/setupscript.html).
1010

1111
## `pyproject.toml`
12-
`pyproject.toml` is the specified file format of [PEP 518](https://peps.python.org/pep-0518/), which contains the building system requirements of the project. A detailed description of `pyproject.toml` can be found in [pip's document](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/). Here, we only utilize a simplified yet practical version that is suitable for most scenarios:
12+
`pyproject.toml` is the specified file format of [PEP 518](https://peps.python.org/pep-0518/), which contains the dependencies of the project. A detailed description of `pyproject.toml` can be found in [pip's document](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/). Here, we only utilize a simplified yet practical version that is suitable for most scenarios:
1313
```toml
1414
[build-system]
1515
requires = [
1616
"setuptools>=42",
1717
"cmake>=3.13",
1818
"scikit-build>=0.14.1",
19+
"pybind11>=2.9.2",
1920
]
2021

2122
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
setup(
1616
name="hybrid_example",
17-
version="0.0.2",
18-
description="Dynamical mean field theory package for material research.",
17+
version="0.1.0",
18+
description="Tutorials about hybrid programming using C++ and Python",
1919
author="Yaozhenghang Ma",
2020
author_email="Yaozhenghang.Ma@gmail.com",
2121
license="MIT",

0 commit comments

Comments
 (0)