Skip to content

Commit f476bbd

Browse files
Merge pull request #8 from cnescatlab/packaging
Packaging for pip & publish
2 parents fcd57ac + a106031 commit f476bbd

File tree

7 files changed

+85
-3
lines changed

7 files changed

+85
-3
lines changed

.github/workflows/python-publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.egg-info/
2+
dist/

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cnes-pylint-extension checks the following rules :
1818

1919
cnes-pylint-extension checks the following metrics :
2020
- R5301 - too-high-complexity (default < 25)
21-
- R5302 - too-high-complexity-simplified (defailt < 20)
21+
- R5302 - too-high-complexity-simplified (default < 20)
2222
- R5201 - too-few-comments (default > 20%)
2323

2424
# Available versions :
@@ -30,11 +30,16 @@ cnes-pylint-extension checks the following metrics :
3030

3131
# To use these checkers:
3232

33-
## Install Pylint
33+
## Install from PIP
34+
`pip install cnes-pylint-extension`
35+
36+
## Install from sources
37+
38+
### Install Pylint
3439

3540
`pip install pylint==2.5.0`
3641

37-
## Install CNES Pylint extension checkers
42+
### Install CNES Pylint extension checkers
3843

3944
Download the project's code source then add the checkers subdirectory to your PYTHONPATH :
4045

@@ -52,6 +57,8 @@ load-plugins=cnes_checker
5257
...
5358
```
5459

60+
## Usage
61+
5562
Pylint is now able to use the extension.
5663

5764
Otherwise, add `--load-plugins=cnes_checker` to your pylint command line in order to activate it.

checkers/__init__.py

Whitespace-only changes.

checkers/cnes_checker/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .cnes_checker import register
2+
3+
def register(linter):
4+
cnes_checker.register(linter)
File renamed without changes.

setup.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import setuptools
2+
3+
with open("README.md", "r") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="cnes-pylint-extension",
8+
version="5.0.0",
9+
author="CNES CatLab",
10+
description="A PyLint plugin to add coding CNES specific checks",
11+
long_description=long_description,
12+
long_description_content_type="text/markdown",
13+
url="https://github.com/cnescatlab/cnes-pylint-extension",
14+
packages=setuptools.find_packages(where='checkers'),
15+
package_dir={'': 'checkers'},
16+
license_file='LICENSE',
17+
classifiers=[
18+
"Programming Language :: Python :: 3",
19+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
20+
"Operating System :: OS Independent",
21+
],
22+
python_requires='>=3.6',
23+
install_requires=[
24+
"pylint-plugin-utils==0.7",
25+
"pylint==2.5.0"
26+
],
27+
project_urls={
28+
'Bug Reports': 'https://github.com/cnescatlab/cnes-pylint-extension/issues'
29+
}
30+
)

0 commit comments

Comments
 (0)