Skip to content

Commit b6ca345

Browse files
authored
Drop py27 support and refactor (#51) (#52)
Python version support ====================== - Drop Python 2.7 support - Add testing for Python 3.4 and 3.9 - Set python version requirements in setup.py Package changes =============== - Split module up into a package with submodules - Break templates out into package resources - Incorporate server into same package - Use Enum for colors - Refresh example badges - Simplify documentation - Remove cli options and python api documentation from the README as it is hard to maintain, and often goes out-of-date - Add CONTRIBUTING.md
1 parent 6de2da8 commit b6ca345

38 files changed

+823
-1119
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,4 @@ demo.svg
116116
htmlcov/
117117

118118
**/*.svg
119+
!anybadge/templates/*.svg

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
dist: xenial
22
language: python
33
python:
4-
- '2.7'
4+
- '3.4'
55
- '3.5'
66
- '3.6'
77
- '3.7'
8+
- '3.8'
9+
- '3.9'
810
install:
911
- pip install -U setuptools pip -r build-requirements.txt
1012
script:
11-
- pytest --doctest-modules --cov=anybadge --cov-report html:htmlcov anybadge.py tests
13+
- pytest --doctest-modules --cov=anybadge --cov-report html:htmlcov anybadge tests
1214
before_deploy:
1315
- sed -i "s/^version = .*/version = __version__ = \"$TRAVIS_TAG\"/" anybadge.py
1416
deploy:
@@ -21,4 +23,4 @@ deploy:
2123
on:
2224
tags: true
2325
all_branches: true
24-
python: '3.7'
26+
python: '3.9'

CONTRIBUTING.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Contributing to anybadge
2+
I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:
3+
4+
- Reporting a bug
5+
- Discussing the current state of the code
6+
- Submitting a fix
7+
- Proposing new features
8+
- Becoming a maintainer
9+
10+
## I use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow), so all code changes happen through pull requests
11+
Pull requests are the best way to propose changes to the codebase (I use
12+
[Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow)). I actively welcome your pull requests:
13+
14+
1. Fork the repo and create your branch from `master`
15+
2. If you've added code that should be tested, add tests
16+
3. If you've changed APIs, update the documentation
17+
4. Ensure the test suite passes
18+
5. Make sure your code lints (tbc)
19+
6. Issue that pull request!
20+
21+
## Any contributions you make will be under the MIT Software License
22+
When you submit code changes, your submissions are understood to be under the same
23+
[MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers
24+
if that's a concern.
25+
26+
## Report bugs using Github's [issues](https://github.com/jongracecox/anybadge/issues)
27+
I use GitHub issues to track public bugs. Report a bug by
28+
[opening a new issue](https://github.com/jongracecox/anybadge/issues/new/choose).
29+
30+
## Write bug reports with detail, background, and sample code
31+
**Great Bug Reports** tend to have:
32+
33+
- A quick summary and/or background
34+
- Steps to reproduce
35+
- Be specific!
36+
- Give sample code if you can (ideally sample code that *anyone* with a basic setup can run to reproduce)
37+
- What you expected would happen - (include explanation, screenshot, drawings, etc. to be exact)
38+
- What actually happens
39+
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
40+
41+
People *love* thorough bug reports.
42+
43+
## Use a Consistent Coding Style
44+
Please follow the existing coding style.
45+
46+
## License
47+
By contributing, you agree that your contributions will be licensed under its MIT License.
48+
49+
# Technical stuff
50+
51+
## Documentation
52+
The `README.md` file contains a table showing example badges for the different built-in colors. If you modify the
53+
appearance of badges, or the available colors please update the table using the following code:
54+
55+
```python
56+
import anybadge
57+
print("""| Color Name | Hex Code | Example |
58+
| ---------- | -------- | ------- |""")
59+
for color in sorted([c for c in anybadge.colors.Color], key=lambda x: x.name):
60+
file = 'examples/color_' + color.name.lower() + '.svg'
61+
url = 'https://cdn.rawgit.com/jongracecox/anybadge/master/' + file
62+
anybadge.Badge(label='Color', value=color, default_color=color.name.lower()).write_badge(file, overwrite=True)
63+
print("| {color} | {hex} | ![]({url}) |".format(color=color.name.lower(), hex=color.value.upper(), url=url))
64+
```

0 commit comments

Comments
 (0)