Skip to content

Commit

Permalink
Merge pull request #8 from cnescatlab/packaging
Browse files Browse the repository at this point in the history
Packaging for pip & publish
  • Loading branch information
louisjdmartin authored Apr 14, 2022
2 parents fcd57ac + a106031 commit f476bbd
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.egg-info/
dist/
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cnes-pylint-extension checks the following rules :

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

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

# To use these checkers:

## Install Pylint
## Install from PIP
`pip install cnes-pylint-extension`

## Install from sources

### Install Pylint

`pip install pylint==2.5.0`

## Install CNES Pylint extension checkers
### Install CNES Pylint extension checkers

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

Expand All @@ -52,6 +57,8 @@ load-plugins=cnes_checker
...
```

## Usage

Pylint is now able to use the extension.

Otherwise, add `--load-plugins=cnes_checker` to your pylint command line in order to activate it.
Empty file removed checkers/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions checkers/cnes_checker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .cnes_checker import register

def register(linter):
cnes_checker.register(linter)
File renamed without changes.
30 changes: 30 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="cnes-pylint-extension",
version="5.0.0",
author="CNES CatLab",
description="A PyLint plugin to add coding CNES specific checks",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/cnescatlab/cnes-pylint-extension",
packages=setuptools.find_packages(where='checkers'),
package_dir={'': 'checkers'},
license_file='LICENSE',
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
install_requires=[
"pylint-plugin-utils==0.7",
"pylint==2.5.0"
],
project_urls={
'Bug Reports': 'https://github.com/cnescatlab/cnes-pylint-extension/issues'
}
)

0 comments on commit f476bbd

Please sign in to comment.