Skip to content

Commit

Permalink
Update skel.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Jul 17, 2020
1 parent 1526b63 commit 2bcf97a
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 78 deletions.
14 changes: 10 additions & 4 deletions .cookiecutterrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cookiecutter:
_extensions:
- jinja2_time.TimeExtension
_template: /home/ionel/open-source/cookiecutter-pylibrary
allow_tests_inside_package: no
appveyor: yes
c_extension_function: '-'
c_extension_module: '-'
Expand All @@ -26,25 +27,30 @@ cookiecutter:
license: BSD 2-Clause License
linter: flake8
package_name: lazy_object_proxy
pre_commit: yes
project_name: lazy-object-proxy
project_short_description: A fast and thorough lazy object proxy.
release_date: '2019-05-10'
repo_hosting: github
pypi_badge: yes
pypi_disable_upload: no
release_date: '2020-06-05'
repo_hosting: github.com
repo_hosting_domain: github.com
repo_name: python-lazy-object-proxy
repo_username: ionelmc
requiresio: yes
scrutinizer: no
setup_py_uses_setuptools_scm: yes
setup_py_uses_test_runner: no
sphinx_docs: yes
sphinx_docs_hosting: https://python-lazy-object-proxy.readthedocs.io/
sphinx_doctest: no
sphinx_theme: sphinx-py3doc-enhanced-theme
test_matrix_configurator: no
test_matrix_separate_coverage: yes
test_runner: pytest
travis: yes
travis_osx: yes
version: 1.4.1
version: 1.5.0
website: https://blog.ionelmc.ro
year_from: '2014'
year_to: '2019'
year_to: '2020'
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ charset = utf-8

[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.{yml,yaml}]
indent_size = 2
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To install the git pre-commit hook run:
# pre-commit install
# To update the pre-commit hooks run:
# pre-commit install-hooks
exclude: '^(.tox|ci/templates|.bumpversion.cfg)(/|$)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/timothycrosley/isort
rev: master
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: master
hooks:
- id: flake8
10 changes: 10 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
sphinx:
configuration: docs/conf.py
formats: all
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To set up `python-lazy-object-proxy` for local development:
(look for the "Fork" button).
2. Clone your fork locally::

git clone [email protected]:ionelmc/python-lazy-object-proxy.git
git clone [email protected]:YOURGITHUBNAME/python-lazy-object-proxy.git

3. Create a branch for local development::

Expand Down
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,14 @@ Overview
:alt: Coverage Status
:target: https://coveralls.io/r/ionelmc/python-lazy-object-proxy

.. |codecov| image:: https://codecov.io/github/ionelmc/python-lazy-object-proxy/coverage.svg?branch=master
.. |codecov| image:: https://codecov.io/gh/ionelmc/python-lazy-object-proxy/branch/master/graphs/badge.svg?branch=master
:alt: Coverage Status
:target: https://codecov.io/github/ionelmc/python-lazy-object-proxy

.. |version| image:: https://img.shields.io/pypi/v/lazy-object-proxy.svg
:alt: PyPI Package latest release
:target: https://pypi.org/project/lazy-object-proxy

.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-lazy-object-proxy/v1.5.0.svg
:alt: Commits since latest release
:target: https://github.com/ionelmc/python-lazy-object-proxy/compare/v1.5.0...master

.. |wheel| image:: https://img.shields.io/pypi/wheel/lazy-object-proxy.svg
:alt: PyPI Wheel
:target: https://pypi.org/project/lazy-object-proxy
Expand All @@ -59,6 +55,11 @@ Overview
:alt: Supported implementations
:target: https://pypi.org/project/lazy-object-proxy

.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-lazy-object-proxy/v1.5.0.svg
:alt: Commits since latest release
:target: https://github.com/ionelmc/python-lazy-object-proxy/compare/v1.5.0...master



.. end-badges
Expand Down
2 changes: 1 addition & 1 deletion ci/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def exec_in_env():
print("+ exec", python_executable, __file__, "--no-env")
os.execv(python_executable, [python_executable, __file__, "--no-env"])


def main():
import jinja2

Expand Down Expand Up @@ -87,4 +88,3 @@ def main():
else:
print("Unexpected arguments {0}".format(args), file=sys.stderr)
sys.exit(1)

1 change: 1 addition & 0 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
virtualenv>=16.6.0
pip>=19.1.1
setuptools>=18.0.1
six>=1.12.0
19 changes: 4 additions & 15 deletions ci/templates/.appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,30 @@ environment:
PYTHON_ARCH: '32'
{% for env in tox_environments %}
{% if env.startswith(('py2', 'py3')) %}
- TOXENV: {{ env }}{% if env.endswith('-cover') %},codecov,coveralls{% endif %}

- TOXENV: {{ env }}{% if env.endswith('-cover') %},codecov,coveralls{% endif %}{{ "" }}
TOXPYTHON: C:\Python{{ env[2:4] }}\python.exe
PYTHON_HOME: C:\Python{{ env[2:4] }}
PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}'
PYTHON_ARCH: '32'
{% if 'nocov' in env %}
WHEEL_PATH: .tox/dist
{% endif %}
- TOXENV: {{ env }}{% if env.endswith('-cover') %},codecov,coveralls{% endif %}

- TOXENV: {{ env }}{% if env.endswith('-cover') %},codecov,coveralls{% endif %}{{ "" }}
TOXPYTHON: C:\Python{{ env[2:4] }}-x64\python.exe
PYTHON_HOME: C:\Python{{ env[2:4] }}-x64
PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}'
PYTHON_ARCH: '64'
{% if 'nocov' in env %}
WHEEL_PATH: .tox/dist
{% endif %}
{% if env.startswith(('py2', 'py34')) %}
WINDOWS_SDK_VERSION: v7.{{ '1' if env.startswith('py3') else '0' }}
{% if env.startswith('py2') %}
WINDOWS_SDK_VERSION: v7.0
{% endif %}
{% endif %}{% endfor %}
init:
- ps: echo $env:TOXENV
- ps: ls C:\Python*
install:
- ps: |
Set-PSDebug -Trace 1
if ($Env:TOXENV.StartsWith("py38")) {
if ($Env:PYTHON_ARCH -eq "64") {
iex "choco install python3 --version=3.8 --no-progress --params /InstallDir:$Env:PYTHON_HOME"
} else {
iex "choco install python3 --version=3.8 --no-progress --params /InstallDir:$Env:PYTHON_HOME --x86"
}
}
- '%PYTHON_HOME%\python -mpip install --progress-bar=off twine tox-wheel -rci/requirements.txt'
- '%PYTHON_HOME%\Scripts\virtualenv --version'
- '%PYTHON_HOME%\Scripts\easy_install --version'
Expand Down
9 changes: 6 additions & 3 deletions ci/templates/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ dist: xenial
cache: false
env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
- SEGFAULT_SIGNALS=all
- LANG=en_US.UTF-8
- TWINE_USERNAME=ionel
matrix:
include:
Expand All @@ -14,8 +16,9 @@ matrix:
env:
- TOXENV=docs
{%- for env in tox_environments %}{{ '' }}
{%- if 'py37' in env or 'py27' in env %}{{ '' }}
{%- if 'py38' in env or 'py27' in env %}{{ '' }}
- os: osx
osx_image: xcode11
language: generic
env:
- TOXENV={{ env }}
Expand Down Expand Up @@ -89,8 +92,8 @@ script:
fi
)
after_failure:
- travis_wait 15 more .tox/log/* | cat
- travis_wait 15 more .tox/*/log/* | cat
- more .tox/log/* | cat
- more .tox/*/log/* | cat
notifications:
email:
on_success: never
Expand Down
11 changes: 3 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import os
import traceback

import sphinx_py3doc_enhanced_theme

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
Expand All @@ -15,15 +16,10 @@
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
if os.getenv('SPELLCHECK'):
extensions += 'sphinxcontrib.spelling',
spelling_show_suggestions = True
spelling_lang = 'en_US'

source_suffix = '.rst'
master_doc = 'index'
project = 'lazy-object-proxy'
year = '2014-2019'
year = '2014-2020'
author = 'Ionel Cristian Mărieș'
copyright = '{0}, {1}'.format(year, author)
try:
Expand All @@ -39,7 +35,6 @@
'issue': ('https://github.com/ionelmc/python-lazy-object-proxy/issues/%s', '#'),
'pr': ('https://github.com/ionelmc/python-lazy-object-proxy/pull/%s', 'PR #'),
}
import sphinx_py3doc_enhanced_theme
html_theme = "sphinx_py3doc_enhanced_theme"
html_theme_path = [sphinx_py3doc_enhanced_theme.get_html_theme_path()]
html_theme_options = {
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[build-system]
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm>=3.3.1"]
requires = [
"setuptools>=30.3.0",
"wheel",
"setuptools_scm>=3.3.1",
]
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ setup_requires =

[flake8]
max-line-length = 140
exclude = */migrations/*
exclude = .tox,.eggs,ci/templates

[tool:pytest]
# If a pytest section is found in one of the possible config files
Expand Down Expand Up @@ -36,6 +36,8 @@ addopts =
--doctest-modules
--doctest-glob=\*.rst
--tb=short
testpaths =
tests

[tool:isort]
force_single_line = True
Expand All @@ -44,4 +46,4 @@ known_first_party = lazy_object_proxy
default_section = THIRDPARTY
forced_separate = test_lazy_object_proxy
not_skip = __init__.py
skip = migrations
skip = .tox,.eggs,ci/templates
17 changes: 9 additions & 8 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ def read(*names, **kwargs):
# Enable code coverage for C code: we can't use CFLAGS=-coverage in tox.ini, since that may mess with compiling
# dependencies (e.g. numpy). Therefore we set SETUPPY_CFLAGS=-coverage in tox.ini and copy it to CFLAGS here (after
# deps have been safely installed).
if 'TOXENV' in os.environ and os.environ.get('SETUPPY_GCOV') == 'enabled' and platform.system() == 'Linux':
CFLAGS = ['-fprofile-arcs', '-ftest-coverage']
LFLAGS = ['-lgcov']
if 'TOX_ENV_NAME' in os.environ and os.environ.get('SETUP_PY_EXT_COVERAGE') == 'yes' and platform.system() == 'Linux':
CFLAGS = os.environ['CFLAGS'] = '-fprofile-arcs -ftest-coverage'
LFLAGS = os.environ['LFLAGS'] = '-lgcov'
else:
CFLAGS = []
LFLAGS = []
CFLAGS = ''
LFLAGS = ''



class optional_build_ext(build_ext):
Expand Down Expand Up @@ -115,7 +116,7 @@ def _unavailable(self, e):
keywords=[
# eg: 'keyword1', 'keyword2', 'keyword3',
],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
install_requires=[
# eg: 'aspectlib==1.1.1', 'six>=1.7',
],
Expand All @@ -129,8 +130,8 @@ def _unavailable(self, e):
Extension(
splitext(relpath(path, 'src').replace(os.sep, '.'))[0],
sources=[path],
extra_compile_args=CFLAGS,
extra_link_args=LFLAGS,
extra_compile_args=CFLAGS.split(),
extra_link_args=LFLAGS.split(),
include_dirs=[dirname(path)]
)
for root, _, _ in os.walk('src')
Expand Down
Loading

0 comments on commit 2bcf97a

Please sign in to comment.