Skip to content

Commit

Permalink
Merge pull request #614 from ReactiveX/reactivex
Browse files Browse the repository at this point in the history
ReactiveX
  • Loading branch information
dbrattli committed Mar 5, 2022
2 parents 2f81dc3 + adaaf6a commit 5066a5c
Show file tree
Hide file tree
Showing 519 changed files with 22,427 additions and 13,229 deletions.
3 changes: 3 additions & 0 deletions .flake8
@@ -0,0 +1,3 @@
[flake8]
ignore = D203,W503
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,tests
92 changes: 68 additions & 24 deletions .github/workflows/pythonpackage.yml
Expand Up @@ -3,50 +3,94 @@ name: Python package
on: [push, pull_request]

jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Cache Poetry
uses: actions/cache@v2
with:
path: |
~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Code checks
run: |
poetry run pre-commit run --all-files --show-diff-on-failure
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, pypy-3.7]
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10", pypy-3.8]
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cache Poetry
uses: actions/cache@v2
with:
path: |
~/.cache/pypoetry
~/Library/Caches/pypoetry
C:\Users\*\AppData\Local\pypoetry\Cache
key: poetry-cache-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: |
pip install poetry
poetry config installer.parallel false
poetry install
- name: Test with pytest
run: |
poetry run pytest -n auto
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Cache Poetry
uses: actions/cache@v2
with:
path: |
~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install poetry
poetry install
- name: Run coverage tests
run: |
coverage run -m pytest
poetry run coverage run -m pytest
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coveralls
poetry run coveralls
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -78,3 +78,8 @@ _build

# Type checkers
.pyre

.ionide/

.python-version
__pycache__
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,36 @@
repos:
- hooks:
- args:
- --remove-all-unused-imports
- --in-place
id: autoflake
repo: https://github.com/humitos/mirrors-autoflake
rev: v1.1
- hooks:
- id: isort
repo: https://github.com/timothycrosley/isort
rev: 5.10.1
- hooks:
- id: black
repo: https://github.com/psf/black
rev: 22.1.0
- hooks:
- id: flake8
exclude: (^docs/|^examples/|^notebooks/|^tests/)
repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- hooks:
- id: pyright
name: pyright
entry: pyright
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["pyright@1.1.226"]
repo: local
- hooks:
- id: mypy
exclude: (^docs/|^examples/|^notebooks/|^tests/|^reactivex/operators/_\w.*\.py$)
repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.931

5 changes: 2 additions & 3 deletions LICENSE
@@ -1,7 +1,6 @@
The MIT License
===============
# The MIT License

Copyright 2013-2019, Dag Brattli, Microsoft Corp., and Contributors.
Copyright 2013-2022, Dag Brattli, Microsoft Corp., and Contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

63 changes: 33 additions & 30 deletions README.rst
@@ -1,52 +1,55 @@
==========================================
The Reactive Extensions for Python (RxPY)
==========================================
===============================
The ReactiveX for Python (RxPY)
===============================

.. image:: https://github.com/ReactiveX/RxPY/workflows/Python%20package/badge.svg
:target: https://github.com/ReactiveX/RxPY/actions
:target: https://github.com/ReactiveX/RxPY/actions
:alt: Build Status

.. image:: https://img.shields.io/coveralls/ReactiveX/RxPY.svg
:target: https://coveralls.io/github/ReactiveX/RxPY
:target: https://coveralls.io/github/ReactiveX/RxPY
:alt: Coverage Status

.. image:: https://img.shields.io/pypi/v/rx.svg
:target: https://pypi.python.org/pypi/Rx
:target: https://pypi.python.org/pypi/Rx
:alt: PyPY Package Version

.. image:: https://img.shields.io/readthedocs/rxpy.svg
:target: https://readthedocs.org/projects/rxpy/builds/
:alt: Documentation Status
:target: https://readthedocs.org/projects/rxpy/builds/
:alt: Documentation Status


*A library for composing asynchronous and event-based programs using observable collections and
query operator functions in Python*
*A library for composing asynchronous and event-based programs using observable
collections and query operator functions in Python*

RxPY v3.0
----------------
ReactiveX for Python (RxPY) v4.0
--------------------------------

For v1.X please go to the `v1 branch <https://github.com/ReactiveX/RxPY/tree/release/v1.6.x>`_.
For v3.X please go to the `v3 branch <https://github.com/ReactiveX/RxPY/tree/master>`_.

RxPY v3.x runs on `Python <http://www.python.org/>`_ 3.6 or above. To install
RxPY v4.x runs on `Python <http://www.python.org/>`_ 3.7 or above. To install
RxPY:

.. code:: console
pip3 install rx
pip3 install reactivex
About ReactiveX
------------------
---------------

Reactive Extensions for Python (RxPY) is a set of libraries for composing
asynchronous and event-based programs using observable sequences and pipable
query operators in Python. Using Rx, developers represent asynchronous data
streams with Observables, query asynchronous data streams using operators, and
parameterize concurrency in data/event streams using Schedulers.
ReactiveX for Python (RxPY) is a set of libraries for composing asynchronous and
event-based programs using observable sequences and pipable query operators in Python.
Using Rx, developers represent asynchronous data streams with Observables, query
asynchronous data streams using operators, and parameterize concurrency in data/event
streams using Schedulers.

.. code:: python
import rx
from rx import operators as ops
import reactivex
from reactivex import operators as ops
source = rx.of("Alpha", "Beta", "Gamma", "Delta", "Epsilon")
source = reactivex.of("Alpha", "Beta", "Gamma", "Delta", "Epsilon")
composed = source.pipe(
ops.map(lambda s: len(s)),
Expand All @@ -55,8 +58,8 @@ parameterize concurrency in data/event streams using Schedulers.
composed.subscribe(lambda value: print("Received {0}".format(value)))
Learning RxPY
--------------
Learning ReactiveX
------------------

Read the `documentation
<https://rxpy.readthedocs.io/en/latest/>`_ to learn
Expand All @@ -77,7 +80,7 @@ Join the conversation on Slack!

The gracious folks at `PySlackers <https://pyslackers.com/>`_ have given us a home
in the `#rxpy <https://pythondev.slack.com/messages/rxpy>`_ Slack channel. Please
join us there for questions, conversations, and all things related to RxPy.
join us there for questions, conversations, and all things related to RxPY.

To join, navigate the page above to receive an email invite. After signing up,
join us in the #rxpy channel.
Expand All @@ -88,11 +91,11 @@ Please follow the community guidelines and terms of service.
Differences from .NET and RxJS
------------------------------

RxPY is a fairly complete implementation of
ReactiveX for Python is a fairly complete implementation of
`Rx <http://reactivex.io/>`_ with more than
`120 operators <https://rxpy.readthedocs.io/en/latest/operators.html>`_, and
over `1300 passing unit-tests <https://coveralls.io/github/ReactiveX/RxPY>`_. RxPY
is mostly a direct port of RxJS, but also borrows a bit from RxNET and RxJava in
is mostly a direct port of RxJS, but also borrows a bit from Rx.NET and RxJava in
terms of threading and blocking operators.

RxPY follows `PEP 8 <http://legacy.python.org/dev/peps/pep-0008/>`_, so all
Expand All @@ -106,7 +109,7 @@ Thus .NET code such as:
var group = source.GroupBy(i => i % 3);
need to be written with an `_` in Python:
need to be written with an ``_`` in Python:

.. code:: python
Expand Down
5 changes: 5 additions & 0 deletions docs/.rstcheck.cfg
@@ -0,0 +1,5 @@
[rstcheck]
ignore_directives=
ignore_roles=
ignore_messages=(Unknown directive type "autoclass".|No directive entry for "autoclass" in module "docutils.parsers.rst.languages.en".|Unknown directive type "automodule".|Unknown directive type "autofunction".|No directive entry for "autofunction" in module "docutils.parsers.rst.languages.en".|No directive entry for "automodule" in module "docutils.parsers.rst.languages.en".)
report=warning

0 comments on commit 5066a5c

Please sign in to comment.