Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper setuptools integration #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy Python Package to PyPI

on: release

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
version: 3.8
- name: sdist
run: |
python setup.py sdist bdist_wheel
- name: upload
env:
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
pip install twine
twine upload dist/*
158 changes: 127 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,127 @@
# Linux/KDE5
.directory

# python
__pycache__/
*.py[cod]
*$py.class

# virtualenv
.venv/
venv/
ENV/
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json

# pyinstaller
build/
dist/
*.manifest
*.spec

# wallabag-cli
.wallabag-cli
.wallabag-cli.bak
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# VSCode cruft
.vscode
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

35 changes: 35 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from setuptools import setup, find_packages

setup(
name='wallabag-cli',
use_scm_version=True,
packages=find_packages('src'),
package_dir={'': 'src'},
url='https://github.com/apetresc/wallabag-cli',
author='Michael Scholz',
description='A command-line client for the self-hosted read-it-later app Wallabag',
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],

setup_requires=[
'pytest-runner==5.1',
'setuptools_scm==3.3.3',
'wheel',
],
install_requires=[
'beautifulsoup4>=4.5.1',
'pycrypto>=2.6.1',
'requests>=2.11.1',
],
tests_require=[
'pytest==4.6.3',
],

entry_points='''
[console_scripts]
wallabag=wallabag.wallabag:main
'''
)
Empty file added src/wallabag/__init__.py
Empty file.
5 changes: 3 additions & 2 deletions wallabag/api.py → src/wallabag/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import time
import re
import requests
import conf
from conf import Configs

from . import conf
from .conf import Configs


MINIMUM_API_VERSION = 2, 1, 1
Expand Down
Loading