Skip to content

Commit ea282ec

Browse files
committed
Updates
1 parent f9ccf72 commit ea282ec

4 files changed

Lines changed: 47 additions & 26 deletions

File tree

.MANIFEST

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Workflow for python project
2+
3+
on: [push, pull_request]
4+
jobs:
5+
run:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
- name: Set up Python 3.9
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.9
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install pycodestyle pydocstyle pyroma coverage pytest
18+
19+
- name: Run tests and collect coverage
20+
run: |
21+
coverage run -m pytest tests
22+
coverage report
23+
coverage xml -o coverage.xml
24+
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v2
27+
28+
- name: Codacy Coverage Reporter
29+
uses: codacy/codacy-coverage-reporter-action@v1.1.0
30+
with:
31+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
32+
coverage-reports: coverage.xml

README.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pyben Enables fast and easy encoding and decoding of bencoded data.
1111

1212
## Prerequisites
1313

14-
* Python3 installed and enabled
14+
* Python3 installed and enabled
1515

1616
## Installing PyBen
1717

@@ -29,34 +29,28 @@ Using git:
2929

3030
The API is intentionally designed to mimic Python's json module.
3131

32-
```python
33-
>>> fd = "path/to/file"
34-
>>> data = {"item1": ["item2", 3, [4], {5: "item6"}]}
35-
>>> encoded = pyben.dumps(data)
36-
>>> encoded
37-
... b'd5:item1l5:item2i3eli4eedi5e5:item6eee'
38-
>>> decoded = pyben.loads(encoded)
39-
... {'item1': ['item2', 3, [4], {5: 'item6'}]}
40-
```
32+
>>> fd = "path/to/file"
33+
>>> data = {"item1": ["item2", 3, [4], {5: "item6"}]}
34+
>>> encoded = pyben.dumps(data)
35+
>>> encoded
36+
... b'd5:item1l5:item2i3eli4eedi5e5:item6eee'
37+
>>> decoded = pyben.loads(encoded)
38+
... {'item1': ['item2', 3, [4], {5: 'item6'}]}
4139

4240
One key difference is that the 'load' and 'dump' methods accept as arguments,
4341
string paths or path objects as well as open iobuffer.
4442

4543
For Example this:
4644

47-
```python
48-
>> with open("encoded.file", "wb") as fd:
49-
... pyben.dump(data, fd)
50-
>> with open("encoded.file", "rb") as fd:
51-
... decoded = pyben.load(fd)
52-
```
45+
>> with open("encoded.file", "wb") as fd:
46+
... pyben.dump(data, fd)
47+
>> with open("encoded.file", "rb") as fd:
48+
... decoded = pyben.load(fd)
5349

5450
is the same as doing following.
5551

56-
```python
57-
>>> pyben.dump(data, "encoded.file")
58-
>>> decoded = pyben.load("encoded.file")
59-
```
52+
>>> pyben.dump(data, "encoded.file")
53+
>>> decoded = pyben.load("encoded.file")
6054

6155
The full API includes many other functions and classes as well.
6256
See docs for more full API.

corbertura.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
2-
<coverage version="5.5" timestamp="1632337319612" lines-valid="523" lines-covered="514" line-rate="0.9828" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
2+
<coverage version="5.5" timestamp="1633465599465" lines-valid="523" lines-covered="514" line-rate="0.9828" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
33
<!-- Generated by coverage.py: https://coverage.readthedocs.io -->
44
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
55
<sources>

0 commit comments

Comments
 (0)