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

Implement release workflow in GitHub actions #734

Merged
merged 19 commits into from Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
754 changes: 754 additions & 0 deletions .github/workflows/ci-cd.yml

Large diffs are not rendered by default.

147 changes: 0 additions & 147 deletions .github/workflows/ci.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/lint.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -23,6 +23,7 @@ To be included in 1.0.0 (unreleased)
* Fix error packet handling for SSCursor #428
* Required python version is now properly documented in python_requires instead of failing on setup.py execution #731
* Add rsa extras_require depending on PyMySQL[rsa] #557
* Self-reported __version__ now returns version from installed package metadata, otherwise unknown #734
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved


0.0.22 (2021-11-14)
Expand Down
14 changes: 9 additions & 5 deletions MANIFEST.in
@@ -1,5 +1,9 @@
include LICENSE
include CHANGES.txt
include README.rst
graft aiomysql
global-exclude *.pyc *.swp
exclude .coveragerc
exclude .flake8
exclude .gitignore
exclude docker-compose.yml
exclude requirements-dev.txt
exclude .github/**
exclude docs/**
exclude examples/**
exclude tests/**
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 0 additions & 3 deletions Makefile
Expand Up @@ -5,9 +5,6 @@ FLAGS=
checkrst:
python setup.py check --restructuredtext

pyroma:
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
pyroma -d .


flake:checkrst pyroma
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
flake8 aiomysql tests examples
Expand Down
10 changes: 9 additions & 1 deletion aiomysql/__init__.py
Expand Up @@ -23,6 +23,11 @@

"""

try:
import pkg_resources
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
except ImportError:
pass

from pymysql.converters import escape_dict, escape_sequence, escape_string
from pymysql.err import (Warning, Error, InterfaceError, DataError,
DatabaseError, OperationalError, IntegrityError,
Expand All @@ -33,7 +38,10 @@
from .cursors import Cursor, SSCursor, DictCursor, SSDictCursor
from .pool import create_pool, Pool

__version__ = '0.0.22'
try:
__version__ = pkg_resources.get_distribution('aiomysql').version
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
except Exception:
__version__ = 'unknown'

__all__ = [

Expand Down
25 changes: 0 additions & 25 deletions docs/conf.py
Expand Up @@ -32,24 +32,6 @@

import re, os.path
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved

def get_release():
regexp = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
here = os.path.dirname(__file__)
root = os.path.dirname(here)
init_py = os.path.join(root, 'aiomysql', '__init__.py')
with open(init_py) as f:
for line in f:
match = regexp.match(line)
if match is not None:
return match.group(1)
else:
raise RuntimeError('Cannot find version in aiomysql/__init__.py')


def get_version(release):
parts = release.split('.')
return '.'.join(parts[:2])

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
Expand Down Expand Up @@ -78,13 +60,6 @@ def get_version(release):
project = 'aiomysql'
copyright = '2015,2016 Nikolay Novik'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
release = get_release()
version = get_version(release)
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
@@ -0,0 +1,9 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools_scm[toml]>=6.4",
"wheel",
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 3 additions & 4 deletions requirements-dev.txt
Expand Up @@ -4,9 +4,8 @@ ipdb==0.13.9
pytest==7.0.1
pytest-cov==3.0.0
pytest-sugar==0.9.4
PyMySQL>=1.0.0,<=1.0.2
sphinx>=1.8.1, <4.4.1
PyMySQL==1.0.2
Sphinx>=4.0
sphinxcontrib-asyncio==0.3.0
sqlalchemy>1.2.12,<=1.3.24
sqlalchemy==1.3.24
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
uvloop==0.16.0; python_version < '3.11'
pyroma==3.2
14 changes: 13 additions & 1 deletion setup.cfg
Expand Up @@ -2,6 +2,11 @@
name = aiomysql
url = https://github.com/aio-libs/aiomysql
download_url = https://pypi.python.org/pypi/aiomysql
project_urls =
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
CI: GitHub = https://github.com/aio-libs/aiomysql/actions
Docs: RTD = https://aiomysql.readthedocs.io/
GitHub: issues = https://github.com/aio-libs/aiomysql/issues
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
GitHub: repo = https://github.com/aio-libs/aiomysql
description = MySQL driver for asyncio.
author = Nikolay Novik
author_email = nickolainovik@gmail.com
Expand Down Expand Up @@ -29,10 +34,12 @@ platforms =
POSIX

[options]
use_scm_version = True
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
python_requires = >=3.7
include_package_data = True

# runtime requirements
packages = find:

install_requires =
PyMySQL>=1.0

Expand All @@ -41,3 +48,8 @@ sa =
sqlalchemy>=1.0,<1.4
rsa =
PyMySQL[rsa]>=1.0

[options.packages.find]
exclude =
tests
tests.*
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
22 changes: 4 additions & 18 deletions setup.py
@@ -1,25 +1,11 @@
import os
import re
from setuptools import setup, find_packages
from setuptools import setup


def read(f):
return open(os.path.join(os.path.dirname(__file__), f)).read().strip()


def read_version():
regexp = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
init_py = os.path.join(os.path.dirname(__file__),
'aiomysql', '__init__.py')
with open(init_py) as f:
for line in f:
match = regexp.match(line)
if match is not None:
return match.group(1)
else:
raise RuntimeError('Cannot find version in aiomysql/__init__.py')


setup(version=read_version(),
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
long_description='\n\n'.join((read('README.rst'), read('CHANGES.txt'))),
packages=find_packages(exclude=['tests', 'tests.*']))
setup(
long_description='\n\n'.join((read('README.rst'), read('CHANGES.txt'))),
Nothing4You marked this conversation as resolved.
Show resolved Hide resolved
)