Skip to content

Prettify MD/YAML files #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug
about: Report a problem

---

**Describe the bug**
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Question
about: Pose an inquiry

---

--
Expand Down
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Fixes # .

Changes proposed in this pull request:
-
## Changes proposed in this pull request:

-
-

Attention: @prkumar
Attention: @prkumar
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/ambv/black
- repo: https://github.com/ambv/black
rev: 21.12b0
hooks:
- id: black
python-version: python3.8
files: ^((uplink|examples|tests)\/.+|setup|docs\/conf)\.py$
- repo: https://github.com/pycqa/flake8
rev: '4.0.1'
- id: black
python-version: python3.8
files: ^((uplink|examples|tests)\/.+|setup|docs\/conf)\.py$
- repo: https://github.com/pycqa/flake8
rev: "4.0.1"
hooks:
- id: flake8
name: flake8
python-version: python3.8
files: ^((uplink|examples|tests)\/.+|setup|docs\/conf)\.py$
- id: flake8
name: flake8
python-version: python3.8
files: ^((uplink|examples|tests)\/.+|setup|docs\/conf)\.py$
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: python
dist: focal
python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
before_script:
- pip install tox
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip install flake8 flake8-bugbear; fi
Expand All @@ -26,5 +26,5 @@ deploy:
secure: 2Gbn5BKdn4VovYg/iQTvVWndfzKm8941aF7mPcZ+Ped4Y1asDW8EEqhBP3Ocknive4HOwe22B4phIqnZ31/g2p/20lo5z/ywULwOCCuoRGTz5lMCFQt4MkJp3fvJwVUShOPJHPW4450UUOqmCoylaXFZsgq5+HLuplCMUgWro7ZiM8mfq6X45iCrHRGXSUh1SSmgSMLYZ7cM80bjvGjP0SlSsh+5ZUS6srDlUxFilH6Cc7+y0CjrnOxk1YIEhk+usLccaewpn0tpdhQf5gLQ6Q+3hj/o/ovnUiPyy4kYeCHjOgcv50JKPWNzM8Ie+9iWNZycs3tvwwZyWRueRMGAjnIO+AigQjuzIoaN8QEt3GyU0Rxxt1qU+KMgBvgSXV66l6w8Q5htpCD1fxIQxdElx+7gZQ1FUm9sHP7BVNVHgKPDP0etO+k5nx9d/1dXVw1CxSO/4zwfJ6VfxFIkIzOleoT7lydzdKsFY/5PlCD2WjErQfbdO8HIqinBwTFG+gfqZnblp64sRNMAcmzkqxN9GocltctRwmPHRbhUP960akeqbKlfQsAXrB2cxMIwYsX8AG21MQ+4hAOgQinAc5AiZ4Gmy7Nq0dxC126uAC9t8Y+4sq2Cwft7xzy/iSMM2hmPOlQx0kWbI7T1eI3FcXvz2aUdLhOz2o5L6VGfie7/RNo=
on:
tags: true
python: '3.7'
python: "3.7"
distributions: "sdist bdist_wheel"
20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
Expand Down
6 changes: 4 additions & 2 deletions docs/source/_templates/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ <h3>Useful Links</h3>
<li><a href="https://pypi.org/project/uplink/">Uplink @ PyPI</a></li>
<li><a href="http://github.com/prkumar/uplink">Uplink @ Github</a></li>
<li><a href="http://github.com/prkumar/uplink/issues">Issue Tracker</a></li>
<li><a href="https://github.com/prkumar/uplink/releases">Release History</a></li>
</ul>
<li>
<a href="https://github.com/prkumar/uplink/releases">Release History</a>
</li>
</ul>
12 changes: 6 additions & 6 deletions docs/source/_templates/navigation.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<h3>{{ _('Table of Contents') }}</h3>
{{ toctree(includehidden=theme_sidebar_includehidden, collapse=theme_sidebar_collapse) }}
{% if theme_extra_nav_links %}
{{ toctree(includehidden=theme_sidebar_includehidden,
collapse=theme_sidebar_collapse) }} {% if theme_extra_nav_links %}
<hr />
<ul>
{% for text, uri in theme_extra_nav_links.items() %}
<li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li>
{% endfor %}
{% for text, uri in theme_extra_nav_links.items() %}
<li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
6 changes: 3 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Examples

This directory contains a few usage examples for Uplink. If you notice a need for a particular example,
This directory contains a few usage examples for Uplink. If you notice a need for a particular example,
feel free to [open an Issue](https://github.com/prkumar/uplink/issues/new). Or, to contribute your own example,
[open a Pull Request](https://github.com/prkumar/uplink/compare) -- please include a README detailing the example's
purpose and add a short description to the "Table of Contents" section below.

## Table of Contents

- **[async-requests](async-requests)**: Use [`aiohttp`](https://github.com/aio-libs/aiohttp) or
- **[async-requests](async-requests)**: Use [`aiohttp`](https://github.com/aio-libs/aiohttp) or
[`twisted`](https://github.com/twisted/twisted) for non-blocking I/O
- **[github-api](github-api)**: Consume the GitHub API to serve a downstream HTTP service with Flask.
- **[handler_callbacks](handler_callbacks)**: Handle client errors and responses using callbacks.
- **[marshmallow](marshmallow)**: Create clients that automatically deserialize responses with the
- **[marshmallow](marshmallow)**: Create clients that automatically deserialize responses with the
help of [`marshmallow`](https://marshmallow.readthedocs.io/en/latest/).
26 changes: 12 additions & 14 deletions examples/async-requests/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Non-Blocking Requests with Uplink

This example details how you can use the same Uplink consumer with different
HTTP clients, with an emphasis on performing non-blocking HTTP requests.
HTTP clients, with an emphasis on performing non-blocking HTTP requests.

## Requirements

Support for `twisted` and `aiohttp` are optional features. To enable these
extras, you can declare them when installing Uplink with ``pip``:
Support for `twisted` and `aiohttp` are optional features. To enable these
extras, you can declare them when installing Uplink with `pip`:

```
# Install both clients (requires Python 3.4+)
Expand All @@ -19,25 +19,23 @@ $ pip install -U uplink[twisted]
$ pip install -U uplink[aiohttp]
```

Notably, while `twisted` features should work on all versions of Python that
Uplink supports, the `aiohttp` library requires Python 3.4 or above.
Notably, while `twisted` features should work on all versions of Python that
Uplink supports, the `aiohttp` library requires Python 3.4 or above.

## Overview

The example includes three Python scripts:

- `github.py`: Defines a `GitHub` API with two methods:
- `GitHub.get_repos`: Gets all public repositories
- `GitHub.get_contributors`: Lists contributors for the specified repository.
The other two scripts are functionally identical. They each use the `GitHub`
- `GitHub.get_repos`: Gets all public repositories
- `GitHub.get_contributors`: Lists contributors for the specified repository.

The other two scripts are functionally identical. They each use the `GitHub`
consumer to fetch contributors for 10 public repositories, concurrently. The
only difference between the scripts is the HTTP client used:

- `asyncio_example.py`: Uses `aiohttp` for awaitable responses to be run with
an `asyncio` event loop.
an `asyncio` event loop.
- `twisted_example.py`: Uses `requests` with `twisted` (inspired by
[`requests-threads`](https://github.com/requests/requests-threads))
to create `Deferred` responses.


[`requests-threads`](https://github.com/requests/requests-threads))
to create `Deferred` responses.
4 changes: 4 additions & 0 deletions examples/github-api/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# GitHub API Example

By: Kareem Moussa ([@itstehkman](https://github.com/itstehkman))

---
Expand All @@ -11,12 +12,14 @@ To try this out, first fill out keys.sh with your github api client id and clien
you can use the API.

Then run

```
source keys.sh
python3 Server.py
```

These are the endpoints I've written:

```
Get a list of users who have committed in repos matching the keyword since oldest-age weeks ago
/users?keyword=<keyword>[?oldest-age=<age in weeks>]
Expand All @@ -29,6 +32,7 @@ Get a list of repos matching the keyword
```

I've written a quick test script to try out all the endpoints:

```
python3 Tests.py
```
4 changes: 3 additions & 1 deletion examples/handler_callbacks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ from the remote server.
Included are two examples:

1. (response_handler) Get the google home page and print the response status code

```
google = Google(base_url=BASE_URL)
google.homepage()
Prints: Google response status: 200
```

2. (error_handler) Get an invalid url and prints the exception type

```
google = Google(base_url="NON_EXISTENT_URL")
google.bad_page()
Prints: Error Encountered. Exception will be raised...
```
```
15 changes: 7 additions & 8 deletions examples/marshmallow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ This example illustrates how to use Uplink with
[`marshmallow`](https://marshmallow.readthedocs.io/en/latest/) to
have your JSON API return Python objects.


## Requirements

Uplink's integration with `marshmallow` is an optional feature. You
can either install `marshmallow` separately or declare the extra when
installing Uplink with ``pip``:
installing Uplink with `pip`:

```
$ pip install -U uplink[marshmallow]
Expand All @@ -26,15 +25,15 @@ This example includes three files:

- `schemas.py`: Defines our schemas for repositories and contributors.
- `github.py`: Defines a `GitHub` API with two methods:
- `GitHub.get_repos`: Gets all public repositories. Uses the
repository schema to return `Repo` objects.
- `GitHub.get_contributors`: Lists contributors for the specified repository.
Uses the contributors schema to return `Contributor` objects.
- `GitHub.get_repos`: Gets all public repositories. Uses the
repository schema to return `Repo` objects.
- `GitHub.get_contributors`: Lists contributors for the specified repository.
Uses the contributors schema to return `Contributor` objects.
- `main.py`: Connects all the pieces with an example that prints to the
console the contributors for the first 10 public repositories.
console the contributors for the first 10 public repositories.

## Challenge

Using the [`async-requests`](../async-requests/) example
as a guide, rewrite `main.py` to make non-blocking requests using
either `aiohttp` or `twisted`.