Skip to content

Commit b00bc1d

Browse files
committed
Submit to the Master Mold
1 parent 507b102 commit b00bc1d

File tree

12 files changed

+179
-78
lines changed

12 files changed

+179
-78
lines changed

.gitignore

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Byte-compiled / optimized / DLL files
2-
__pycache__/
2+
__pycache__
33
*.py[cod]
44
*$py.class
5-
6-
# C extensions
75
*.so
86

97
# Distribution / packaging
@@ -24,41 +22,13 @@ wheels/
2422
.installed.cfg
2523
*.egg
2624
MANIFEST
27-
*.manifest
28-
*.spec
29-
pip-wheel-metadata
30-
31-
# Installer logs
32-
pip-log.txt
33-
pip-delete-this-directory.txt
34-
35-
# Unit test / coverage reports
36-
htmlcov/
37-
.tox/
38-
.coverage
39-
.coverage.*
40-
.cache
41-
nosetests.xml
42-
coverage.xml
43-
*.cover
44-
.hypothesis/
45-
.pytest_cache/
46-
47-
# Translations
48-
*.mo
49-
*.pot
50-
51-
# Sphinx documentation
52-
docs/_build/
5325

5426
# Environments
5527
.env
5628
.venv
57-
env/
58-
venv/
59-
ENV/
60-
env.bak/
61-
venv.bak/
29+
covreport
30+
pip-wheel-metadata
31+
.tox
6232

6333
# mkdocs documentation
6434
/site

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: python
2+
3+
matrix:
4+
include:
5+
- python: 3.5
6+
- python: 3.6
7+
- python: 3.7
8+
dist: xenial
9+
sudo: true
10+
11+
before_install:
12+
- pip install -U pip pytest
13+
14+
install:
15+
- pip install .
16+
17+
script: pytest -x .

LICENSE.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-
23-
Except as contained in this notice, the name of the author shall not be used in
24-
advertising or otherwise to promote the sale, use or other dealings in this Software
25-
without prior written authorization from the author.

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ help:
44
@echo "clean - remove build/python artifacts"
55
@echo "test - run tests"
66
@echo "flake - check style with flake8"
7+
@echo "coverage - generate an HTML report of the coverage"
78
@echo "install - install for development"
89

910
clean: clean-build clean-pyc
@@ -13,21 +14,25 @@ clean-build:
1314
rm -rf dist/
1415
rm -rf *.egg-info
1516
rm -rf pip-wheel-metadata
17+
rm *.egg-info
1618

1719
clean-pyc:
1820
find . -name '*.pyc' -exec rm -f {} +
1921
find . -name '*.pyo' -exec rm -f {} +
2022
find . -name '*~' -exec rm -f {} +
2123
find . -name '__pycache__' -exec rm -rf {} +
2224
find . -name '.pytest_cache' -exec rm -rf {} +
23-
find . -name '*.egg-info' -exec rm -rf {} +
2425

2526
test:
26-
pytest -x texteditor tests
27+
pytest -x .
2728

2829
flake:
29-
flake8 --config=setup.cfg texteditor tests
30+
flake8 --config=setup.cfg .
31+
32+
coverage:
33+
pytest --cov-report html --cov texteditor .
3034

3135
install:
3236
pip install -e .
33-
pip install -r requirements-dev.txt
37+
pip install .[docs]
38+
pip install .[testing]

__init__.py

Whitespace-only changes.

mm.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env python
2+
"""
3+
COPY THIS FILE TO YOUR PROJECT.
4+
---------
5+
This file generates all the necessary files for packaging for the project.
6+
Read more about it at https://github.com/jpscaletti/mastermold/
7+
"""
8+
from pathlib import Path
9+
10+
import copier
11+
from ruamel.yaml import YAML
12+
13+
14+
data = {
15+
"title": "TextEditor",
16+
"name": "texteditor",
17+
"pypi_name": "text-editor",
18+
"version": "1.0.5",
19+
"author": "Juan-Pablo Scaletti",
20+
"author_email": "juanpablo@jpscaletti.com",
21+
"description": "Like webbrowser, but for the text editor.",
22+
"repo_name": "jpscaletti/texteditor",
23+
"home_url": "",
24+
"docs_url": "",
25+
"development_status": "5 - Production/Stable",
26+
"install_requires": [],
27+
"entry_points": "",
28+
"minimal_python": 3.5,
29+
30+
"coverage_omit": [],
31+
32+
"has_docs": False,
33+
"docs_nav": [], # Overwritten by `save_current_nav`.
34+
}
35+
36+
37+
def save_current_nav():
38+
yaml = YAML()
39+
mkdocs_path = Path("docs") / "mkdocs.yml"
40+
if not mkdocs_path.exists():
41+
return
42+
mkdocs = yaml.load(mkdocs_path)
43+
data["docs_nav"] = mkdocs.get("nav")
44+
45+
46+
def do_the_thing():
47+
if data["has_docs"]:
48+
save_current_nav()
49+
50+
copier.copy(
51+
"gh:jpscaletti/mastermold.git",
52+
".",
53+
data=data,
54+
exclude=[
55+
"copier.yml",
56+
"README.md",
57+
".git",
58+
".git/*",
59+
".venv",
60+
".venv/*",
61+
62+
"docs",
63+
"docs/*",
64+
"CONTRIBUTING.md",
65+
],
66+
force=True,
67+
cleanup_on_error=False
68+
)
69+
70+
71+
if __name__ == "__main__":
72+
do_the_thing()

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools>=34.4", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
1-
# Read more about `setup.cfg`:
2-
# https://docs.python.org/3/distutils/configfile.html
1+
[metadata]
2+
name = text-editor
3+
version= 1.0.5
4+
author = Juan-Pablo Scaletti
5+
author_email = juanpablo@jpscaletti.com
6+
description = Like webbrowser, but for the text editor.
7+
long_description = file:README.md
8+
long_description_content_type = text/markdown
9+
url = https://github.com/jpscaletti/texteditor
10+
license_file = LICENSE.txt
11+
classifiers =
12+
Development Status :: 5 - Production/Stable
13+
Intended Audience :: Developers
14+
License :: OSI Approved :: MIT License
15+
Programming Language :: Python :: 3
16+
17+
18+
[bdist_wheel]
19+
universal = 1
20+
21+
22+
[options]
23+
include_package_data = true
24+
packages = find:
25+
python_requires = >=3.5,<4.0
26+
install_requires =
27+
28+
29+
[options.packages.find]
30+
exclude =
31+
tests
32+
33+
[options.extras_require]
34+
testing =
35+
pytest
36+
pytest-cov
37+
pytest-flake8
38+
flake8
39+
ipdb
40+
tox
41+
42+
docs =
43+
44+
45+
[options.entry_points]
46+
47+
348

449
[flake8]
550
max-complexity = 10
@@ -21,5 +66,6 @@ select = C,E,F,W,B,B950
2166
# D107 Missing docstring in __init__
2267
ignore = W503,E203,D100,D101,D102,D103,D104,D105,D107
2368

69+
2470
[tool:pytest]
2571
addopts = --doctest-modules

setup.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,6 @@
1-
from pathlib import Path
1+
#!/usr/bin/env python
22

3-
from setuptools import find_packages, setup
3+
import setuptools
44

5-
6-
HERE = Path(__file__).parent.resolve()
7-
8-
9-
setup(
10-
name="text-editor",
11-
version="1.0.5",
12-
description="Like webbrowser, but for the text editor.",
13-
long_description=(HERE / "README.md").read_text(),
14-
long_description_content_type="text/markdown",
15-
author="Juan-Pablo Scaletti",
16-
author_email="juanpablo@jpscaletti.com",
17-
python_requires=">=3.5,<4.0",
18-
url="https://github.com/jpscaletti/texteditor",
19-
# install_requires=[],
20-
license="MIT",
21-
packages=find_packages(exclude=["tests"]),
22-
classifiers=[
23-
# Trove classifiers
24-
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
25-
"Development Status :: 5 - Production/Stable",
26-
"Intended Audience :: Developers",
27-
"Topic :: Software Development :: Libraries :: Python Modules",
28-
"Operating System :: OS Independent",
29-
"Programming Language :: Python :: 3.5",
30-
"Programming Language :: Python :: 3.6",
31-
"Programming Language :: Python :: 3.7",
32-
],
33-
)
5+
if __name__ == "__main__":
6+
setuptools.setup()

tests/conftest.py

Whitespace-only changes.

texteditor/version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import pkg_resources
22

33

4-
__version__ = pkg_resources.require("text-editor")[0].version
4+
try:
5+
__version__ = pkg_resources.require("text-editor")[0].version
6+
except Exception: # pragma:no cover
7+
# Run pytest without needing to install the library
8+
__version__ = None

tox.ini

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
[tox]
22
skipsdist = True
3-
envlist=py35,py36,py37,py38
3+
envlist =py35,py36,py37,py38
44

55
[testenv]
66
skip_install = true
77
commands =
88
pip install -U pytest
99
pip install -e .
10-
pytest -x texteditor tests
10+
pytest -x .
11+
12+
[coverage:run]
13+
branch = True
14+
15+
[coverage:report]
16+
exclude_lines =
17+
pragma:no cover
18+
def __repr__
19+
raise NotImplementedError
20+
if __name__ == .__main__.:
21+
if 0:
22+
23+
24+
[coverage:html]
25+
directory = covreport

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy