create bordel de merde setup.py for drone
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
bf29c63744
commit
279004cd58
3 changed files with 174 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.1.0
|
rev: v4.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
@ -19,7 +19,7 @@ repos:
|
||||||
- "--max-line-length=200"
|
- "--max-line-length=200"
|
||||||
- "--ignore=E501,W5O3"
|
- "--ignore=E501,W5O3"
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 21.12b0
|
rev: 22.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
name: black (python)
|
name: black (python)
|
||||||
|
@ -27,7 +27,7 @@ repos:
|
||||||
- '-S'
|
- '-S'
|
||||||
- '-l 200'
|
- '-l 200'
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v0.931
|
rev: v0.942
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
additional_dependencies: [pydantic] # add if use pydantic
|
additional_dependencies: [pydantic] # add if use pydantic
|
||||||
|
@ -38,24 +38,24 @@ repos:
|
||||||
name: isort (python)
|
name: isort (python)
|
||||||
args: ['--profile', 'black']
|
args: ['--profile', 'black']
|
||||||
- repo: https://github.com/PyCQA/bandit
|
- repo: https://github.com/PyCQA/bandit
|
||||||
rev: 1.7.1
|
rev: 1.7.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: bandit
|
- id: bandit
|
||||||
exclude: ^tests/
|
exclude: ^tests/
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.31.0
|
rev: v2.32.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
name: pylint
|
name: pylint
|
||||||
entry: pylint --disable=E1101,E0401,C0301,W1514 --ignore=__init__.py --ignore-patterns=(.)*_test\.py,test_(.)*\.py
|
entry: pylint --disable=E1101,E0401,C0301,W1514 --ignore=__init__.py --ignore=setup.py --ignore-patterns=(.)*_test\.py,test_(.)*\.py
|
||||||
language: system
|
|
||||||
types: [python]
|
|
||||||
- id: pytest
|
|
||||||
name: Check pytest unit tests pass
|
|
||||||
entry: pytest
|
|
||||||
pass_filenames: false
|
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
|
# - id: pytest
|
||||||
|
# name: Check pytest unit tests pass
|
||||||
|
# entry: pytest
|
||||||
|
# pass_filenames: false
|
||||||
|
# language: system
|
||||||
|
# types: [python]
|
||||||
|
|
99
README.rst
Normal file
99
README.rst
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
|
||||||
|
|
||||||
|
.. image:: https://drone.fqserv.eu/api/badges/takaoni/tenkan/status.svg
|
||||||
|
:target: https://drone.fqserv.eu/takaoni/tenkan
|
||||||
|
:alt: Build Status
|
||||||
|
|
||||||
|
|
||||||
|
tenkan
|
||||||
|
======
|
||||||
|
|
||||||
|
Command line tool to convert HTTP RSS/Atom feeds to gemini format.
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
|
||||||
|
```shell script
|
||||||
|
pip install tenkan
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Add a feed
|
||||||
|
```shell script
|
||||||
|
# Any valid RSS/Atom feed
|
||||||
|
tenkan add feedname url
|
||||||
|
|
||||||
|
Update content of feed list
|
||||||
|
```shell script
|
||||||
|
tenkan update
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
|
||||||
|
Delete feed
|
||||||
|
```shell script
|
||||||
|
tenkan delete feedname
|
||||||
|
|
||||||
|
List subscripted feeds
|
||||||
|
```shell script
|
||||||
|
tenkan list
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
## Options
|
||||||
|
A debug mode is avaible via --debug option.
|
||||||
|
If you want to use your configuration or feeds file in another place than default one, you can use --config and --feedsfile options.
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
tenkan searches for a configuration file at the following location:
|
||||||
|
|
||||||
|
`$XDG_CONFIG_HOME/tenkan/tenkan.conf`
|
||||||
|
|
||||||
|
### Example config
|
||||||
|
This can be found in tenkan.conf.example.
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[tenkan]
|
||||||
|
gemini_path = /usr/local/gemini/
|
||||||
|
gemini_url = gemini://foo.bar/feeds/
|
||||||
|
# will purge feed folders having more than defined element count
|
||||||
|
# purge_feed_folder_after = 100
|
||||||
|
|
||||||
|
[filters]
|
||||||
|
# authors we don't want to read
|
||||||
|
# authors_blacklist = foo, bar
|
||||||
|
# blacklist of article titles, if provided, it won't be processed
|
||||||
|
# titles_blacklist = foo, bar
|
||||||
|
# blacklist of article links, if provided, it won't be processed
|
||||||
|
# links_blacklist = foo/bar.com, bar/foo, bla
|
||||||
|
|
||||||
|
[formatting]
|
||||||
|
# maximum article title size, 120 chars if not provided
|
||||||
|
# title_size = 120
|
||||||
|
|
||||||
|
# feeds with a truncated content
|
||||||
|
# will be fetched and converted using readability
|
||||||
|
# truncated_feeds = foo, bar
|
||||||
|
|
||||||
|
Todolist
|
||||||
|
--------
|
||||||
|
|
||||||
|
|
||||||
|
* [ ] Add a edit command
|
||||||
|
* [ ] Add a --feedname option to update command, to update a single feed
|
||||||
|
* [ ] Rewrite configuration checks
|
||||||
|
* [ ] add configuration option to log output into a logfile
|
||||||
|
* [ ] Improve tests
|
||||||
|
* [ ] Refactor needed parts like write_article
|
||||||
|
* [ ] (not sure if relevant) migrate images too, for gemini clients that can handle it
|
||||||
|
|
||||||
|
Development
|
||||||
|
-----------
|
||||||
|
|
||||||
|
I recommend using pre-commit. The pre-commit configuration I use is located in .pre-commit-config.yamlfile.
|
||||||
|
|
||||||
|
Run pre-commit command before every pull request and fix the warnings or errors it produces.
|
63
setup.py
Normal file
63
setup.py
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# DO NOT EDIT THIS FILE!
|
||||||
|
# This file has been autogenerated by dephell <3
|
||||||
|
# https://github.com/dephell/dephell
|
||||||
|
|
||||||
|
try:
|
||||||
|
from setuptools import setup
|
||||||
|
except ImportError:
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
|
||||||
|
readme = ''
|
||||||
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
readme_path = os.path.join(here, 'README.rst')
|
||||||
|
if os.path.exists(readme_path):
|
||||||
|
with open(readme_path, 'rb') as stream:
|
||||||
|
readme = stream.read().decode('utf8')
|
||||||
|
|
||||||
|
|
||||||
|
setup(
|
||||||
|
long_description=readme,
|
||||||
|
name='tenkan',
|
||||||
|
version='0.1.2',
|
||||||
|
description='RSS/atom feed converter from html to gemini',
|
||||||
|
python_requires='==3.*,>=3.8.0',
|
||||||
|
project_urls={'repository': 'https://git.fqserv.eu/takaoni/tenkan'},
|
||||||
|
author='Quentin Ferrand',
|
||||||
|
author_email='quentin.ferrand@protonmail.com',
|
||||||
|
license='WTFPL',
|
||||||
|
entry_points={'console_scripts': ['tenkan = tenkan.cli:main']},
|
||||||
|
packages=['tenkan'],
|
||||||
|
package_dir={'': '.'},
|
||||||
|
package_data={},
|
||||||
|
install_requires=[
|
||||||
|
'datetime==4.*,>=4.3.0',
|
||||||
|
'feedgen==0.*,>=0.9.0',
|
||||||
|
'feedparser==6.*,>=6.0.8',
|
||||||
|
'markdownify==0.*,>=0.10.0',
|
||||||
|
'md2gemini==1.*,>=1.8.1',
|
||||||
|
'prettytable==3.*,>=3.0.0',
|
||||||
|
'readability-lxml==0.*,>=0.8.1',
|
||||||
|
'requests==2.*,>=2.26.0',
|
||||||
|
'rich==10.*,>=10.16.2',
|
||||||
|
],
|
||||||
|
extras_require={
|
||||||
|
'dev': [
|
||||||
|
'bandit==1.*,>=1.7.1',
|
||||||
|
'black==21.*,>=21.11.0.b1',
|
||||||
|
'flake8==4.*,>=4.0.1',
|
||||||
|
'isort==5.*,>=5.10.1',
|
||||||
|
'mypy==0.*,>=0.910.0',
|
||||||
|
'pylint==2.*,>=2.12.2',
|
||||||
|
'pytest==5.*,>=5.2.0',
|
||||||
|
'pytest-cov==3.*,>=3.0.0',
|
||||||
|
'pyupgrade==2.*,>=2.31.0',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
)
|
Loading…
Reference in a new issue