Feature: setup (#15)

* add files for setup

* ! package rename

* move scripts

* + setuptools_scm_git_archive

* + fallback_version

* + setuptools_scm_git_archive to setup.cfg

* bdist_wheel universal

* ignore build/ and .eggs/

* don't use version from setuptools_scm

* Revert "don't use version from setuptools_scm"

This reverts commit 7ad0b4d3d8.

* Revert "bdist_wheel universal"

This reverts commit 5027866b39.

* no-local-version

* +workflow: Upload Python Package
This commit is contained in:
Dmitry Belyaev 2020-02-19 23:26:28 +03:00 committed by GitHub
parent fcba8f07ef
commit a96050628a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 905 additions and 813 deletions

1
.git_archival.txt Normal file
View File

@ -0,0 +1 @@
ref-names: $Format:%D$

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
.git_archival.txt export-subst

26
.github/workflows/pythonpublish.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools_scm setuptools_scm_git_archive wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

4
.gitignore vendored
View File

@ -3,3 +3,7 @@ service-account.json
*.pyc
my-test*.ics
.vscode/*
/dist/
/*.egg-info/
/build/
/.eggs/

7
MANIFEST.in Normal file
View File

@ -0,0 +1,7 @@
include pyproject.toml
# Include the README
include *.md
# Include the license file
include LICENSE

3
pyproject.toml Normal file
View File

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=40.8.0", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"

7
setup.cfg Normal file
View File

@ -0,0 +1,7 @@
[metadata]
license_files = LICENSE
[options]
setup_requires =
setuptools_scm
setuptools_scm_git_archive

44
setup.py Normal file
View File

@ -0,0 +1,44 @@
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='sync-ics2gcal',
author='Dmitry Belyaev',
author_email='b4tm4n@mail.ru',
license='MIT',
description='Sync ics file with Google calendar',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/b4tman/sync_ics2gcal',
use_scm_version={
'fallback_version': '0.1',
'local_scheme': 'no-local-version'
},
setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'],
packages=setuptools.find_packages(exclude=['tests']),
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
python_requires='>=3.5',
install_requires = [
'google-auth>=1.5.0',
'google-api-python-client>=1.7.0',
'icalendar>=4.0.1',
'pytz',
'PyYAML>=3.13'
],
entry_points={
"console_scripts": [
"sync-ics2gcal = sync_ics2gcal.sync_calendar:main",
"manage-ics2gcal = sync_ics2gcal.manage_calendars:main",
]
}
)

View File

@ -5,7 +5,7 @@ import logging.config
import yaml
from pytz import utc
from gcal_sync import GoogleCalendar, GoogleCalendarService
from . import GoogleCalendar, GoogleCalendarService
def parse_args():

View File

@ -4,14 +4,13 @@ import dateutil.parser
import datetime
import logging
import logging.config
from gcal_sync import (
from . import (
CalendarConverter,
GoogleCalendarService,
GoogleCalendar,
CalendarSync
)
def load_config():
with open('config.yml', 'r', encoding='utf-8') as f:
result = yaml.safe_load(f)

View File

@ -1,6 +1,6 @@
import pytest
from gcal_sync import CalendarConverter
from sync_ics2gcal import CalendarConverter
uid = "UID:uisgtr8tre93wewe0yr8wqy@test.com"
only_start_date = uid + """

View File

@ -8,7 +8,7 @@ import dateutil.parser
import pytest
from pytz import timezone, utc
from gcal_sync import CalendarSync
from sync_ics2gcal import CalendarSync
def sha1(string):