Skip to content

Commit e781a1a

Browse files
Fix public comment & docs update (#5)
1 parent 6462a20 commit e781a1a

File tree

16 files changed

+363
-144
lines changed

16 files changed

+363
-144
lines changed

.github/workflows/build-docs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: build-docs
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2.3.4
11+
- uses: actions/setup-python@v2.1.4
12+
with:
13+
python-version: "3.8"
14+
architecture: "x64"
15+
16+
- name: Install Dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
python -m pip install -e .[docs]
20+
21+
- name: Build Docs
22+
run: |
23+
git fetch --all
24+
mkdocs gh-deploy -m "Update Docs" --remote-branch gh-pages

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install Dependencies
2020
run: |
2121
python -m pip install --upgrade pip
22-
python -m pip install pytest==6.2.2 pytest-cov==2.11.1
22+
python -m pip install -e .[dev]
2323
2424
- name: Test with pytest
2525
run: |

docs/_coverpage.md

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

docs/_sidebar.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

docs/CHANGELOG.md renamed to docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.2.0] - 24/07/2021
6+
7+
- [Version 0.2.0 by @hakancelik96](https://github.com/hakancelik96/pyall/pull/5)
8+
- Docs update
9+
- pyall: public ( bug fix )
10+
511
## [0.1.0] - 11/04/2021
612

713
- [Version V0.1.0 by @hakancelik96](https://github.com/hakancelik96/pyall/pull/1)

docs/CONTRIBUTING.md renamed to docs/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ If all tests pass.
4949
## The final step
5050

5151
After adding a new feature or fixing a bug please report your change to
52-
[CHANGELOG.md](CHANGELOG.md) and write your name, GitHub address, and email in the
53-
[AUTHORS.md](AUTHORS.md) file in alphabetical order.
52+
[CHANGELOG.md](changelog.md) and write your name, GitHub address, and email in the
53+
[AUTHORS.md](authors.md) file in alphabetical order.
5454

5555
### Commit Messages
5656

docs/index.html

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

docs/README.md renamed to docs/index.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,117 @@ packaging tools. We recommend installing the latest stable release from PyPI wit
2828
$ pip install pyall
2929
```
3030

31+
## Sources
32+
33+
> (optional: default `the file directory you are in`) -> `Path(".")`
34+
35+
You can give as many file or directory paths as you want.
36+
37+
**Usage**
38+
39+
- `$ pyall`
40+
- `$ pyall example`
41+
- `$ pyall example example1 example2 example/example.py`
42+
43+
## Include
44+
45+
> (optional: default '\\.(py)$') file include pattern
46+
47+
**Usage**
48+
49+
- `$ pyall --include mypackage`
50+
- `$ pyall --include "mypackage|tests`
51+
52+
## Exclude
53+
54+
> (optional: default '^$') file exclude pattern
55+
56+
**Usage**
57+
58+
- `$ pyall --exclude __init__.py`
59+
- `$ pyall --exclude "__init__.py|tests|.tox`
60+
61+
## Default public states.
62+
63+
- Variables are defined with an upper letters.
64+
65+
```python
66+
VARIABLE = "variable"
67+
68+
PUBLIC_VARIABLE = "variable"
69+
```
70+
71+
- functions, or classes that do not begin with an underscore are public.
72+
73+
```python
74+
75+
def function():
76+
...
77+
78+
79+
class Klass:
80+
...
81+
82+
```
83+
84+
### Make It not-public
85+
86+
Write the comment `# pyall: not-public` on the line containing the variable, function
87+
and class that you want to make public.
88+
89+
```python
90+
91+
VARIABLE = "variable" # pyall: not-public
92+
93+
def function(): # pyall: not-public
94+
...
95+
96+
class Klass: # pyall: not-public
97+
...
98+
99+
```
100+
101+
## Default not-public states.
102+
103+
- The variable is not public unless all characters are uppercase.
104+
105+
```python
106+
variable = "variable"
107+
108+
Variable = "variable"
109+
110+
```
111+
112+
- Variables, functions, and classes that begin with an underscore are not public.
113+
114+
```python
115+
_VARIABLE = "variable"
116+
117+
def _function():
118+
...
119+
120+
class _Klass:
121+
...
122+
123+
```
124+
125+
### Make It Public
126+
127+
Write the comment `# pyall: public` on the line containing the variable, function and
128+
class that you want to make public.
129+
130+
```python
131+
132+
_variable = "variable" # pyall: public
133+
134+
def _function(): # pyall: public
135+
...
136+
137+
class _Klass: # pyall: public
138+
...
139+
140+
```
141+
31142
### Command line options
32143

33144
You can list many options by running pyall --help
@@ -66,3 +177,49 @@ repos:
66177
- id: pyall
67178
args: [--refactor]
68179
```
180+
181+
## Examples
182+
183+
**/example.py**
184+
185+
```python
186+
187+
PUBLIC_VARIABLE = "variable"
188+
189+
def _not_public_function():
190+
...
191+
192+
class PublicKlass:
193+
...
194+
195+
196+
class _NotPublicKlass:
197+
...
198+
199+
200+
public_variable = "variable" # pyall: public
201+
202+
```
203+
204+
> Command line: `$ pyall /example.py -r`
205+
206+
**Output**
207+
208+
```python
209+
__all__ = ['PUBLIC_VARIABLE', 'PublicKlass', 'public_variable']
210+
211+
PUBLIC_VARIABLE = "variable"
212+
213+
def _not_public_function():
214+
...
215+
216+
class PublicKlass:
217+
...
218+
219+
220+
class _NotPublicKlass:
221+
...
222+
223+
224+
public_variable = "variable" # pyall: public
225+
```

0 commit comments

Comments
 (0)