Skip to content

Commit 4c73370

Browse files
Abhishek's Macbook ProAbhishek's Macbook Pro
Abhishek's Macbook Pro
authored and
Abhishek's Macbook Pro
committed
Added changelog
1 parent 9f7de13 commit 4c73370

File tree

3 files changed

+203
-0
lines changed

3 files changed

+203
-0
lines changed

changelog/2-0-0.txt

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2.0.0
2+
-----
3+
4+
New Features
5+
--------
6+
- Copy Import statement
7+
- Generate and copy `django` or `pytest` supported test path
8+
- Run `django` or `pytest` tests
9+
10+
11+
Upcoming Features
12+
-----------------
13+
- Autocomplete
14+
- Project level plugin settings
15+
16+
17+
Updated Settings
18+
----------------
19+
{
20+
"paths_to_scan": [], // Not used as of now
21+
"python_venv_path": "",
22+
"python_interpreter_path": "", // Not used as of now
23+
"log_level": "info",
24+
"import_scan_depth": 4,
25+
"test_config": {
26+
"enabled": false, // Enable or disable run test feature, default false
27+
"test_framework": "", // django or pytest
28+
"working_directory": "", // Working directory of your project
29+
"test_runner_command": [], // Command to execute when clicking `Run as test`
30+
}
31+
}
32+
33+
- `test_config.enabled`
34+
- **Description**: Enable or disable run test feature
35+
- **Type**: `str`
36+
- **Allowed Values**: `true` or `false`
37+
- **Default**: `false`
38+
> ⚠️ If its `false` then it will ignore all other settings in `test_config`
39+
40+
- `test_config.test_framework`
41+
- **Description**: Defines what library is used for running the test
42+
- **Type**: `str`
43+
- **Allowed Values**: `django` or `pytest`
44+
- **Default**: NA
45+
> ⚠️ This assumes that `django` or `pytest` is pre-installed in your python env
46+
47+
- `test_config.working_directory`
48+
- **Description**: Working directory of your project, this will be used to define what is the root of project
49+
- **Type**: `str`
50+
- **Allowed Values**: Valid Path
51+
- **Default**: NA
52+
- **Example**:
53+
```
54+
"working_directory": "/Users/abhishek/django-app/"
55+
```
56+
57+
- `test_config.test_runner_command`
58+
- **Description**: Command to execute when clicking `Run as test`
59+
- **Type**: `List[str]`
60+
- **Allowed Values**: NA
61+
- **Default**: NA
62+
- **Example**
63+
```json
64+
// For Django
65+
"test_runner_command": ["python", "manage.py", "test", "--keepdb"]
66+
67+
// For Pytest
68+
"test_runner_command": ["pytest"]
69+
```
70+
71+
Usage
72+
-----
73+
- To Run Tests:
74+
- Write your tests and save it as `test_*.py`, the file name has to be prefixed with `test_`
75+
- Then as you save it will show `Run as test` annotation on individual test class and methods, if you click on any of them it will run that particular test
76+
> If in between you want to run another test you can simply click on the `Run as test` but this will terminate any running test and starts the new one.

changelog/install.txt

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
PyRock
2+
================
3+
Sublime plugin to generate import statement for python
4+
5+
6+
Features
7+
--------
8+
- Generate's Import statement
9+
- Copy Import statement
10+
- Generate and copy `django` or `pytest` supported test path
11+
- Run `django` or `pytest` tests
12+
- Supports virtual enviroment
13+
14+
Upcoming Features
15+
-----------------
16+
- Autocomplete
17+
- Project level plugin settings
18+
19+
Installation
20+
------------
21+
- From sublime package control install package enter name `PyRock`
22+
- OR
23+
- Clone this git repo and put it in your sublime packages folder
24+
25+
Settings
26+
--------
27+
{
28+
"paths_to_scan": [], // Not used as of now
29+
"python_venv_path": "",
30+
"python_interpreter_path": "", // Not used as of now
31+
"log_level": "info",
32+
"import_scan_depth": 4,
33+
"test_config": {
34+
"enabled": false, // Enable or disable run test feature, default false
35+
"test_framework": "", // django or pytest
36+
"working_directory": "", // Working directory of your project
37+
"test_runner_command": [], // Command to execute when clicking `Run as test`
38+
}
39+
}
40+
41+
- `paths_to_scan`: This is still in development, it will have no effect as of now.
42+
- `python_interpreter_path`: This is still in development, it will have no effect as of now.
43+
- `python_venv_path` : Specifies which python env to use when indexing files, if not given it will choose the default python interpreter of your system (Make sure you have set any default python, otherwise it will not be able to index). It takes the full path to `activate` file of the virtual environment, for example:
44+
```
45+
"python_venv_path": "/Users/abhishek/venv/bin/activate"
46+
```
47+
- `log_level`: By default set to `info`, accepted values `info`, `debug`, `error`, `warning`
48+
- `import_scan_depth`: This defines how deep it will scan any python package, the higher the number the more deep it will go, `4` is an optimal depth, you can increase it but it will also increase the time to index all files, so change it carefully.
49+
50+
- `test_config.enabled`
51+
- **Description**: Enable or disable run test feature
52+
- **Type**: `str`
53+
- **Allowed Values**: `true` or `false`
54+
- **Default**: `false`
55+
> ⚠️ If its `false` then it will ignore all other settings in `test_config`
56+
57+
- `test_config.test_framework`
58+
- **Description**: Defines what library is used for running the test
59+
- **Type**: `str`
60+
- **Allowed Values**: `django` or `pytest`
61+
- **Default**: NA
62+
> ⚠️ This assumes that `django` or `pytest` is pre-installed in your python env
63+
64+
- `test_config.working_directory`
65+
- **Description**: Working directory of your project, this will be used to define what is the root of project
66+
- **Type**: `str`
67+
- **Allowed Values**: Valid Path
68+
- **Default**: NA
69+
- **Example**:
70+
```
71+
"working_directory": "/Users/abhishek/django-app/"
72+
```
73+
74+
- `test_config.test_runner_command`
75+
- **Description**: Command to execute when clicking `Run as test`
76+
- **Type**: `List[str]`
77+
- **Allowed Values**: NA
78+
- **Default**: NA
79+
- **Example**
80+
```json
81+
// For Django
82+
"test_runner_command": ["python", "manage.py", "test", "--keepdb"]
83+
84+
// For Pytest
85+
"test_runner_command": ["pytest"]
86+
```
87+
88+
Usage
89+
-----
90+
- Upon installation it automatically reads the settings and scans your python environment for packages and index them.
91+
You will see progress of indexing in status bar, like this:
92+
93+
- For some reason if indexing didn't happened or you want to re-index after you have removed/installed packages in your python environment, you can do so by calling `Re-Index Imports` from command pallate or just right-click to open menu and under `PyRock` you will see `Re-Index Imports`
94+
95+
- To generate python import, select the text (min 2 characters) then right click and under `PyRock` click `Import Symbol`, it will show you the suggestion out which you select any and it will add that import statement into your python script.
96+
97+
- To Run Tests:
98+
- Write your tests and save it as `test_*.py`, the file name has to be prefixed with `test_`
99+
- Then as you save it will show `Run as test` annotation on individual test class and methods, if you click on any of them it will run that particular test
100+
> If in between you want to run another test you can simply click on the `Run as test` but this will terminate any running test and starts the new one.
101+
102+
Key Bindings
103+
------------
104+
- By default key bindings for this plugin are disabled, to enable it you simply goto `Preferences` -> `Package Settings` -> `PyRock` -> `Key Bindings` and then copy paste from left view to your right view and uncomment it or you can copy the below directly to your right view and save it:
105+
[
106+
// Both of the key binding generate import statement suggestions for the selected text
107+
{
108+
"keys": ["super+shift+;"],
109+
"command": "py_rock",
110+
"args": { "action": "import_symbol" }
111+
},
112+
{
113+
"keys": ["ctrl+shift+;"],
114+
"command": "py_rock",
115+
"args": { "action": "import_symbol" }
116+
}
117+
]
118+
119+
Compatibility
120+
-------------
121+
- Require Sublime Text version >= 4
122+
- Works for `Python Imports` only
123+
- Best experience with linter support [Optional]

messages.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"install": "changelog/install.txt",
3+
"2.0.0": "changelog/2-0-0.txt"
4+
}

0 commit comments

Comments
 (0)