Skip to content

Commit 8fcdf72

Browse files
authored
Merge pull request #615 from ReactiveX/github-publish
Add publish action and dynamic versioning
2 parents 5066a5c + becb44c commit 8fcdf72

File tree

7 files changed

+108
-22
lines changed

7 files changed

+108
-22
lines changed
File renamed without changes.

.github/workflows/python-publish.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
name: "Publish library"
11+
steps:
12+
- name: Check out
13+
uses: actions/checkout@v3
14+
with:
15+
token: "${{ secrets.GITHUB_TOKEN }}"
16+
fetch-depth: 0
17+
18+
- name: Setup Python Env
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: '3.9'
22+
23+
- name: Install dependencies
24+
run: |
25+
pip install poetry
26+
poetry version $(dunamai from any --no-metadata --style pep440)
27+
poetry install
28+
29+
- name: Build package
30+
run: poetry build
31+
32+
- name: Release to PyPI
33+
run: |
34+
poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} || echo 'Version exists'

README.rst

+52-16
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ The ReactiveX for Python (RxPY)
1010
:target: https://coveralls.io/github/ReactiveX/RxPY
1111
:alt: Coverage Status
1212

13-
.. image:: https://img.shields.io/pypi/v/rx.svg
14-
:target: https://pypi.python.org/pypi/Rx
13+
.. image:: https://img.shields.io/pypi/v/reactivex.svg
14+
:target: https://pypi.org/project/reactivex/
1515
:alt: PyPY Package Version
1616

1717
.. image:: https://img.shields.io/readthedocs/rxpy.svg
@@ -22,13 +22,14 @@ The ReactiveX for Python (RxPY)
2222
*A library for composing asynchronous and event-based programs using observable
2323
collections and query operator functions in Python*
2424

25-
ReactiveX for Python (RxPY) v4.0
26-
--------------------------------
25+
ReactiveX for Python v4
26+
-----------------------
2727

28-
For v3.X please go to the `v3 branch <https://github.com/ReactiveX/RxPY/tree/master>`_.
28+
For v3.X please go to the `v3 branch
29+
<https://github.com/ReactiveX/RxPY/tree/release/v3.2.x>`_.
2930

30-
RxPY v4.x runs on `Python <http://www.python.org/>`_ 3.7 or above. To install
31-
RxPY:
31+
ReactiveX for Python v4.x runs on `Python <http://www.python.org/>`_ 3.7 or above. To
32+
install:
3233

3334
.. code:: console
3435
@@ -46,10 +47,10 @@ streams using Schedulers.
4647

4748
.. code:: python
4849
49-
import reactivex
50+
import reactivex as rx
5051
from reactivex import operators as ops
5152
52-
source = reactivex.of("Alpha", "Beta", "Gamma", "Delta", "Epsilon")
53+
source = rx.of("Alpha", "Beta", "Gamma", "Delta", "Epsilon")
5354
5455
composed = source.pipe(
5556
ops.map(lambda s: len(s)),
@@ -63,7 +64,7 @@ Learning ReactiveX
6364

6465
Read the `documentation
6566
<https://rxpy.readthedocs.io/en/latest/>`_ to learn
66-
the principles of RxPY and get the complete reference of the available
67+
the principles of ReactiveX and get the complete reference of the available
6768
operators.
6869

6970
If you need to migrate code from RxPY v1.x, read the `migration
@@ -98,8 +99,8 @@ over `1300 passing unit-tests <https://coveralls.io/github/ReactiveX/RxPY>`_. Rx
9899
is mostly a direct port of RxJS, but also borrows a bit from Rx.NET and RxJava in
99100
terms of threading and blocking operators.
100101

101-
RxPY follows `PEP 8 <http://legacy.python.org/dev/peps/pep-0008/>`_, so all
102-
function and method names are lowercase with words separated by underscores as
102+
ReactiveX for Python follows `PEP 8 <http://legacy.python.org/dev/peps/pep-0008/>`_, so
103+
all function and method names are lowercase with words separated by underscores as
103104
necessary to improve readability.
104105

105106
Thus .NET code such as:
@@ -115,7 +116,42 @@ need to be written with an ``_`` in Python:
115116
116117
group = source.pipe(ops.group_by(lambda i: i % 3))
117118
118-
With RxPY you should use `named keyword arguments
119-
<https://docs.python.org/3/glossary.html>`_ instead of positional arguments when
120-
an operator has multiple optional arguments. RxPY will not try to detect which
121-
arguments you are giving to the operator (or not).
119+
With ReactiveX for Python you should use `named keyword arguments
120+
<https://docs.python.org/3/glossary.html>`_ instead of positional arguments when an
121+
operator has multiple optional arguments. RxPY will not try to detect which arguments
122+
you are giving to the operator (or not).
123+
124+
Development
125+
-----------
126+
127+
This project is managed using `Poetry <https://python-poetry.org/>`_. Code is formatted
128+
using `Black <https://github.com/psf/black>`_, `isort
129+
<https://github.com/PyCQA/isort>`_. Code is statically type checked using `pyright
130+
<https://github.com/microsoft/pyright>`_ and `mypy <http://mypy-lang.org/>`_.
131+
132+
If you want to take advantage of the default VSCode integration, then
133+
first configure Poetry to make its virtual environment in the
134+
repository:
135+
136+
.. code:: console
137+
138+
poetry config virtualenvs.in-project true
139+
140+
After cloning the repository, activate the tooling:
141+
142+
.. code:: console
143+
144+
poetry install
145+
poetry run pre-commit install
146+
147+
Run unit tests:
148+
149+
.. code:: console
150+
151+
poetry run pytest
152+
153+
Run code checks (manually):
154+
155+
.. code:: console
156+
157+
poetry run pre-commit run --all-files

docs/migration.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Migration v4
44
============
55

6-
ReactiveX for Python v4 is an evolution of RxPY v3 to modenize it to
6+
ReactiveX for Python v4 is an evolution of RxPY v3 to modernize it to
77
current Python standards:
88

99
- Project main module renamed from ``rx`` to ``reactivex``. This is done

poetry.lock

+17-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
2-
name = "reactivex"
3-
version = "4.0.0a4" # Make sure the version here is the same as in _version.py
2+
name = "ReactiveX"
3+
version = "0.0.0"
44
description = "ReactiveX (Rx) for Python"
55
readme = "README.rst"
66
authors = ["Dag Brattli <[email protected]>"]
@@ -43,6 +43,7 @@ flake8 = "^4.0.1"
4343
coveralls = "^3.3.1"
4444
pre-commit = "^2.17.0"
4545
autoflake = "^1.4"
46+
dunamai = "^1.9.0"
4647

4748
[tool.black]
4849
line-length = 88

reactivex/_version.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# Please make sure the version here remains the same as in pyproject.toml
2-
__version__ = "4.0.0a4"
1+
__version__ = "$(dunamai from any)"

0 commit comments

Comments
 (0)