Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
OrbisK authored Jun 13, 2022
1 parent 303011d commit 933d3a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test

on:
push:
branches: [ "feature/test-ci" ]
branches: [ "main" ]

jobs:
build-and-publish:
Expand All @@ -22,7 +22,7 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: Python Semantic Release
env: # Or as an environment variable
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
Expand Down
60 changes: 2 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,6 @@
## repository for pylint configurations and plugins

Extensions in pylint are not implemented so as a workaround the extensions are implemented as pylint plugins.

The following extensions exists in this repo:

1. pylint_sit (pylint extension)
2. pylint_sit_django (pylint extension django)

Every extension has its own directory with the following subdirectories and files:

- `src` Directory
- an extension file inside `src`, for example ``src/pylint_sit.py``
- a virtual environment, we are using ``venv``
- a requirements file: ``requirements.txt``
- a `README.md` as long description for the extension
- a `LICENSE` for the extension
- a `setup.cfg` for the extension
- a `setup.py` for the extension

The ``dist`` directory will automatically be created.

### Create a new extension

We created an example directory ``example_extension`` with all its necessary files.
1. copy ``example_extension`` as a new extension and name it correctly.
2. ``cd`` into it and create a virtual environment: `virtualenv venv`
3. Install the packages from ``requirements.txt``: `pip install -r requirements.txt`
4. Rename ``src/example_extension.py`` and modify it to your needs.
5. Run ``python -m build``. A `dist` directory will be created with your packaged extension
7. Verify extension reading the paragraph **Verify extension**


### Update existing extension

- Update the extension .py file to your needs
- Update the ``setup.cfg`` file:
- increase build version
- optional: update ``install_requires``
- optional: update ``README.md``

### Verify extension
1. Install it locally:
- ``cd`` into extension root directory
- Run ``pip install -e .``
2. Create an Error test file:
- Create an example file `test.py` and insert a failure in that file you want to check.
3. Run ``pylint test.py --load-plugins <EXTENSION_NAME>``

### Build a package extension

- Create a new ``.wheel`` and ``.tar.gz``
- ``cd`` into the root directory of the extension and create a virtual environment: `virtualenv venv`
- Install the packages from ``requirements.txt``: `pip install -r requirements.txt`
- Rename ``src/example_extension.py`` and modify it to your needs.
- Run ``python -m build``. A `dist` directory will be created with your packaged extension
- Optional: Upload the extension to ``pypi``
- Run ``twine upload dist/pylint_sit-<NEW_BUILD_VERSION>*`` & username and password are required
# pylint_sit

TODO @Grayknife pls fix this

### Contribute
TODO
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[semantic-release]
version= "0.0.1"
version= "0.0.0"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ where = src
version_variable=pyproject.toml:version
upload_to_pypi=False
upload_to_release=True
branch=feature/test-ci
branch=main
version_source=tag

0 comments on commit 933d3a3

Please sign in to comment.