Skip to content

Commit

Permalink
Running formatter to cleanup files.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed May 4, 2024
1 parent 2d2b69f commit ad75496
Show file tree
Hide file tree
Showing 15 changed files with 438 additions and 146 deletions.
420 changes: 351 additions & 69 deletions CHANGELOG.md

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ named_tunnel = ngrok.connect(name="my_tunnel_name")
```

The [`connect`](https://pyngrok.readthedocs.io/en/latest/api.html#pyngrok.ngrok.connect) method takes `kwargs` as
well, which allows us to pass additional properties that are [supported by `ngrok`](https://ngrok.com/docs/secure-tunnels/ngrok-agent/reference/config/#tunnel-definitions).
well, which allows us to pass additional properties that
are [supported by `ngrok`](https://ngrok.com/docs/secure-tunnels/ngrok-agent/reference/config/#tunnel-definitions).

This package puts the default `ngrok` binary on our path, so all features of `ngrok` are
available on the command line.
Expand All @@ -63,11 +64,13 @@ available on the command line.
ngrok http 80
```

For details on how to fully leverage `ngrok` from the command line, see [`ngrok`'s official documentation](https://ngrok.com/docs).
For details on how to fully leverage `ngrok` from the command line,
see [`ngrok`'s official documentation](https://ngrok.com/docs).

## Documentation

For more advanced usage, `pyngrok`'s official documentation is available at [http://pyngrok.readthedocs.io](http://pyngrok.readthedocs.io).
For more advanced usage, `pyngrok`'s official documentation is available
at [http://pyngrok.readthedocs.io](http://pyngrok.readthedocs.io).

### `ngrok` Version Compatibility

Expand All @@ -76,7 +79,9 @@ For more advanced usage, `pyngrok`'s official documentation is available at [htt

## Contributing

If you would like to get involved, be sure to review the [Contribution Guide](https://github.com/alexdlaird/pyngrok/blob/main/CONTRIBUTING.rst).
If you would like to get involved, be sure to review
the [Contribution Guide](https://github.com/alexdlaird/pyngrok/blob/main/CONTRIBUTING.rst).

Want to contribute financially? If you've found `pyngrok` useful, [sponsorship](https://github.com/sponsors/alexdlaird) would
Want to contribute financially? If you've found `pyngrok` useful, [sponsorship](https://github.com/sponsors/alexdlaird)
would
also be greatly appreciated!
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

## Reporting a Vulnerability

If you suspect you have found a security vulnerability, send an email to [contact@alexlaird.com](mailto:contact@alexlaird.com).
If you suspect you have found a security vulnerability, send an email
to [contact@alexlaird.com](mailto:contact@alexlaird.com).
Please include a clear and concise description of what the vulnerability is, where it is exposed in the code, and (if
known) what best practices might apply to patching it.

Expand Down
2 changes: 1 addition & 1 deletion docs/_html/sitemap-index.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
>
<url>
<loc>https://pyngrok.readthedocs.io/en/stable/</loc>
<changefreq>weekly</changefreq>
Expand Down
86 changes: 45 additions & 41 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,55 +1,59 @@
{% extends "!layout.html" %}

{%- block extrahead %}
{{ super() }}
{{ super() }}

<meta name="description"
content="A Python wrapper for ngrok that manages its own binary, making ngrok available via a convenient Python API."/>
<meta content="A Python wrapper for ngrok that manages its own binary, making ngrok available via a convenient Python API."
name="description"/>

<!-- Twitter Card data -->
<meta name="twitter:title" content="pyngrok - A Python wrapper for ngrok">
<meta name="twitter:card"
value="A Python wrapper for ngrok that manages its own binary, making ngrok available via a convenient Python API.">
<!-- Twitter Card data -->
<meta content="pyngrok - A Python wrapper for ngrok" name="twitter:title">
<meta name="twitter:card"
value="A Python wrapper for ngrok that manages its own binary, making ngrok available via a convenient Python API.">

<!-- Open Graph data -->
<meta property="og:title" content="pyngrok - A Python wrapper for ngrok"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="https://pyngrok.readthedocs.io/en/latest/{{ pagename }}.html"/>
<meta property="og:image" content="https://pyngrok.readthedocs.io/en/latest/_images/logo.png"/>
<meta property="og:description"
content="A Python wrapper for ngrok that manages its own binary, making ngrok available via a convenient Python API."/>
<!-- Open Graph data -->
<meta content="pyngrok - A Python wrapper for ngrok" property="og:title"/>
<meta content="website" property="og:type"/>
<meta content="https://pyngrok.readthedocs.io/en/latest/{{ pagename }}.html" property="og:url"/>
<meta content="https://pyngrok.readthedocs.io/en/latest/_images/logo.png" property="og:image"/>
<meta content="A Python wrapper for ngrok that manages its own binary, making ngrok available via a convenient Python API."
property="og:description"/>

<meta name="yandex-verification" content="ac8f18b56add6591"/>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-43184722-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
<meta content="ac8f18b56add6591" name="yandex-verification"/>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-43184722-4"></script>
<script>
window.dataLayer = window.dataLayer || [];

function gtag() {
dataLayer.push(arguments);
}
function gtag() {
dataLayer.push(arguments);
}

gtag('js', new Date());
gtag('js', new Date());

gtag('config', 'UA-43184722-4');
</script>
gtag('config', 'UA-43184722-4');
</script>
{% endblock %}

{% block footer %}
{{ super() }}
<a href="https://github.com/{{ theme_github_user }}/{{ theme_github_repo }}" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png?resize=149%2C149" alt="Fork me on GitHub" alt="Fork me on GitHub" class="github">
</a>
<div class="footer">This page uses <a href="https://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function () {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
{{ super() }}
<a class="github" href="https://github.com/{{ theme_github_user }}/{{ theme_github_repo }}">
<img alt="Fork me on GitHub"
alt="Fork me on GitHub"
class="github"
src="https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png?resize=149%2C149"
style="position: absolute; top: 0; right: 0; border: 0;">
</a>
<div class="footer">This page uses <a href="https://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function () {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
{% endblock %}
24 changes: 13 additions & 11 deletions docs/_templates/sidebartoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@ <h3>Getting Around</h3>
<ul>
<li><a class="reference internal" href="{{ pathto(master_doc) }}">Basic Usage</a>
<ul>
<li><a class="reference internal" href="{{ pathto(master_doc) | trim("#") }}#installation">Installation</a>
<li><a # class="reference internal" href="{{ pathto(master_doc) | trim("") }}#installation">Installation</a>
</li>
<li><a class="reference internal" href="{{ pathto(master_doc) | trim("#") }}#open-a-tunnel">Open a
<li><a # class="reference internal" href="{{ pathto(master_doc) | trim("") }}#open-a-tunnel">Open a
Tunnel</a></li>
<li><a class="reference internal"
href="{{ pathto(master_doc) | trim("#") }}#configuration">Configuration</a></li>
<li><a class="reference internal" href="{{ pathto(master_doc) | trim("#") }}#event-logs">Event Logs</a></li>
<li><a class="reference internal" href="{{ pathto(master_doc) | trim("#") }}#command-line-usage">Command
<li><a #
class="reference internal" href="{{ pathto(master_doc) | trim("") }}#configuration">Configuration</a>
</li>
<li><a # class="reference internal" href="{{ pathto(master_doc) | trim("") }}#event-logs">Event Logs</a>
</li>
<li><a # class="reference internal" href="{{ pathto(master_doc) | trim("") }}#command-line-usage">Command
Line Usage</a>
</li>
</ul>
</li>
<li><a class="reference internal" href="{{ pathto(master_doc) | trim("#") }}#dive-deeper">Dive Deeper</a>
<li><a # class="reference internal" href="{{ pathto(master_doc) | trim("") }}#dive-deeper">Dive Deeper</a>
<ul>
<li><a class="reference internal" href="{{ pathto("api") }}">API Documentation</a></li>
<li><a class="reference internal" href="{{ pathto("integrations") }}">Integration Examples</a></li>
<li><a class="reference internal" href="{{ pathto("troubleshooting") }}">Troubleshooting</a></li>
<li><a api class="reference internal" href="{{ pathto("") }}">API Documentation</a></li>
<li><a class="reference internal" href="{{ pathto(" integrations") }}">Integration Examples</a></li>
<li><a class="reference internal" href="{{ pathto(" troubleshooting") }}">Troubleshooting</a></li>
<li><a href="https://github.com/alexdlaird/pyngrok/blob/main/CHANGELOG.md">Changelog</a></li>
<li><a href="https://github.com/alexdlaird/pyngrok/issues">Issues</a></li>
<li><a class="reference internal" href="{{ pathto(master_doc) | trim("#") }}#contributing">Contributing</a>
<li><a # class="reference internal" href="{{ pathto(master_doc) | trim("") }}#contributing">Contributing</a>
</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion pyngrok/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import os
import platform
from typing import Optional, Callable
from typing import Callable, Optional

from pyngrok.installer import get_ngrok_bin
from pyngrok.log import NgrokLog
Expand Down
2 changes: 1 addition & 1 deletion pyngrok/exception.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__copyright__ = "Copyright (c) 2018-2024 Alex Laird"
__license__ = "MIT"

from typing import Any, Optional, List
from typing import Any, List, Optional

from pyngrok.log import NgrokLog

Expand Down
2 changes: 1 addition & 1 deletion pyngrok/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import yaml

from pyngrok.exception import PyngrokNgrokInstallError, PyngrokSecurityError, PyngrokError
from pyngrok.exception import PyngrokError, PyngrokNgrokInstallError, PyngrokSecurityError

logger = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions pyngrok/ngrok.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import sys
import uuid
from http import HTTPStatus
from typing import Optional, Any, Dict, List, Tuple
from typing import Any, Dict, List, Optional, Tuple
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
from urllib.request import urlopen, Request
from urllib.request import Request, urlopen

from pyngrok import process, conf, installer, __version__
from pyngrok import __version__, conf, installer, process
from pyngrok.conf import PyngrokConfig
from pyngrok.exception import PyngrokNgrokHTTPError, PyngrokNgrokURLError, PyngrokSecurityError, PyngrokError
from pyngrok.exception import PyngrokError, PyngrokNgrokHTTPError, PyngrokNgrokURLError, PyngrokSecurityError
from pyngrok.installer import get_default_config
from pyngrok.process import NgrokProcess

Expand Down
4 changes: 2 additions & 2 deletions pyngrok/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import threading
import time
from http import HTTPStatus
from typing import Dict, List, Optional, Any
from typing import Any, Dict, List, Optional
from urllib.request import Request, urlopen

import yaml

from pyngrok import conf, installer
from pyngrok.conf import PyngrokConfig
from pyngrok.exception import PyngrokNgrokError, PyngrokSecurityError, PyngrokError
from pyngrok.exception import PyngrokError, PyngrokNgrokError, PyngrokSecurityError
from pyngrok.installer import SUPPORTED_NGROK_VERSIONS
from pyngrok.log import NgrokLog

Expand Down
4 changes: 2 additions & 2 deletions tests/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import socket
from unittest import mock

from pyngrok import ngrok, installer, conf
from pyngrok import conf, installer, ngrok
from pyngrok.conf import PyngrokConfig
from pyngrok.exception import PyngrokNgrokInstallError, PyngrokSecurityError, PyngrokError
from pyngrok.exception import PyngrokError, PyngrokNgrokInstallError, PyngrokSecurityError
from tests.testcase import NgrokTestCase


Expand Down
7 changes: 3 additions & 4 deletions tests/test_ngrok.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

import yaml

from pyngrok import __version__
from pyngrok import ngrok, process, installer
from pyngrok.exception import PyngrokNgrokHTTPError, PyngrokNgrokURLError, PyngrokSecurityError, PyngrokError, \
PyngrokNgrokError
from pyngrok import __version__, installer, ngrok, process
from pyngrok.exception import PyngrokError, PyngrokNgrokError, PyngrokNgrokHTTPError, PyngrokNgrokURLError, \
PyngrokSecurityError
from tests.testcase import NgrokTestCase


Expand Down
2 changes: 1 addition & 1 deletion tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from urllib.parse import urlparse
from urllib.request import urlopen

from pyngrok import process, installer, conf, ngrok
from pyngrok import conf, installer, ngrok, process
from pyngrok.exception import PyngrokNgrokError
from pyngrok.process import NgrokLog
from tests.testcase import NgrokTestCase
Expand Down
3 changes: 1 addition & 2 deletions tests/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import psutil
from psutil import AccessDenied, NoSuchProcess

from pyngrok import ngrok, installer, conf
from pyngrok import process
from pyngrok import conf, installer, ngrok, process
from pyngrok.conf import PyngrokConfig

logger = logging.getLogger(__name__)
Expand Down

0 comments on commit ad75496

Please sign in to comment.