You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2020/06/22 15:38:09 UTC
[skywalking-python] 01/01: Add docs for how to build from sources
and fail the builds when flake8 fails
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch doc-and-chore
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git
commit e3f435c9fffe361d23bc19d61773d842213f387a
Author: kezhenxu94 <ke...@163.com>
AuthorDate: Mon Jun 22 23:37:38 2020 +0800
Add docs for how to build from sources and fail the builds when flake8 fails
---
Makefile | 4 ++--
README.md | 2 ++
docs/FAQ.md | 16 ++++++++++++++--
tests/plugin/sw_http/__init__.py | 1 -
tests/plugin/sw_http_wsgi/__init__.py | 1 -
tests/plugin/sw_http_wsgi/services/provider.py | 2 --
tests/plugin/sw_requests/__init__.py | 1 -
tests/plugin/sw_requests/services/consumer.py | 1 -
8 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 92f13c8..89d6cee 100644
--- a/Makefile
+++ b/Makefile
@@ -35,8 +35,8 @@ gen:
lint: clean
flake8 --version || python3 -m pip install flake8
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+ flake8 . --count --select=E9,F63,F7,F82 --show-source
+ flake8 . --count --max-complexity=12 --max-line-length=120
license: clean
python3 tools/check-license-header.py skywalking tests tools
diff --git a/README.md b/README.md
index fdbf6ab..67e372a 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,8 @@ microservices, cloud native and container-based (Docker, Kubernetes, Mesos) arch
SkyWalking Python SDK requires SkyWalking 8.0+.
+> If you want to try out the latest features that're not released yet, please refer to [the guide](docs/FAQ.md#q-how-to-build-from-sources) to build from sources.
+
```python
from skywalking import agent, config
diff --git a/docs/FAQ.md b/docs/FAQ.md
index eaefae7..9153fc9 100644
--- a/docs/FAQ.md
+++ b/docs/FAQ.md
@@ -1,7 +1,8 @@
# FAQ
-Q: How to disable some plugins?
-A: You can find the plugin name in [the list](../README.md#supported-libraries) and disable one or more plugins by following methods.
+#### Q: How to disable some plugins?
+
+#### A: You can find the plugin name in [the list](../README.md#supported-libraries) and disable one or more plugins by following methods.
```python
from skywalking import config
@@ -10,3 +11,14 @@ config.disable_plugins = ['sw_http_server', 'sw_urllib_request'] # can be also
```
you can also disable the plugins via environment variables `SW_AGENT_DISABLE_PLUGINS`.
+
+#### Q: How to build from sources?
+
+#### A: If you want to build the SkyWalking Python Agent from sources, for some reasons, for example, you want to try the latest features
+that're not released yet, please clone the source codes and `make install` it:
+
+```shell
+git clone https://github.com/apache/skywalking-python
+cd skywalking-python
+make install
+```
diff --git a/tests/plugin/sw_http/__init__.py b/tests/plugin/sw_http/__init__.py
index 6222972..b1312a0 100644
--- a/tests/plugin/sw_http/__init__.py
+++ b/tests/plugin/sw_http/__init__.py
@@ -14,4 +14,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
diff --git a/tests/plugin/sw_http_wsgi/__init__.py b/tests/plugin/sw_http_wsgi/__init__.py
index 6222972..b1312a0 100644
--- a/tests/plugin/sw_http_wsgi/__init__.py
+++ b/tests/plugin/sw_http_wsgi/__init__.py
@@ -14,4 +14,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
diff --git a/tests/plugin/sw_http_wsgi/services/provider.py b/tests/plugin/sw_http_wsgi/services/provider.py
index e15f33b..a8c4b84 100644
--- a/tests/plugin/sw_http_wsgi/services/provider.py
+++ b/tests/plugin/sw_http_wsgi/services/provider.py
@@ -26,13 +26,11 @@ if __name__ == '__main__':
from werkzeug import Request, Response
-
@Request.application
def application(request):
time.sleep(0.5)
return Response('{"song": "Despacito", "artist": "Luis Fonsi"}')
-
from werkzeug.serving import run_simple
PORT = 9091
diff --git a/tests/plugin/sw_requests/__init__.py b/tests/plugin/sw_requests/__init__.py
index 6222972..b1312a0 100644
--- a/tests/plugin/sw_requests/__init__.py
+++ b/tests/plugin/sw_requests/__init__.py
@@ -14,4 +14,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
diff --git a/tests/plugin/sw_requests/services/consumer.py b/tests/plugin/sw_requests/services/consumer.py
index ff7ec9b..4328fc1 100644
--- a/tests/plugin/sw_requests/services/consumer.py
+++ b/tests/plugin/sw_requests/services/consumer.py
@@ -27,7 +27,6 @@ if __name__ == '__main__':
import socketserver
from http.server import BaseHTTPRequestHandler
-
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_POST(self):
self.send_response(200)