Skip to content

Commit e17bea9

Browse files
committed
Modernize packaging and CI (pyproject.toml, Tox, GHA)
1 parent 076d7d5 commit e17bea9

File tree

13 files changed

+292
-107
lines changed

13 files changed

+292
-107
lines changed

.github/workflows/pipeline.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Pipeline
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
- '[0-9]+.[0-9]+.[0-9]+'
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
env:
18+
- lint
19+
- format
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
- run: pip install tox
26+
- run: tox run -e ${{ matrix.env }}
27+
28+
test:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version:
33+
- '3.10'
34+
- '3.11'
35+
- '3.12'
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- run: pip install tox
42+
- run: tox run -e py
43+
44+
publish:
45+
if: startsWith(github.ref, 'refs/tags/')
46+
needs:
47+
- check
48+
- test
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: actions/setup-python@v5
53+
with:
54+
python-version: '3.12'
55+
- name: Install build tools
56+
run: pip install tox
57+
- name: Verify package version is same as Git tag
58+
run: tox run -qe ensure_version_matches -- $GIT_TAG
59+
env:
60+
GIT_TAG: ${{ github.ref_name }}
61+
- name: Build package and upload to PyPI
62+
run: tox run -e package -- upload
63+
env:
64+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
65+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

.gitignore

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Bytecode
12
*.py[co]
23

34
# Packages
5+
django_bootstrap_static-*/
46
*.egg
57
*.egg-info
68
dist
@@ -20,10 +22,10 @@ pip-log.txt
2022
.coverage
2123
.tox
2224

23-
#Translations
25+
# Translations
2426
*.mo
2527

26-
#Mr Developer
28+
# Mr Developer
2729
.mr.developer.cfg
2830
.idea
29-
*.DS_Store
31+
*.DS_Store

.travis.yml

-32
This file was deleted.

AUTHORS.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Maintainers
22
-----------
33

4-
* Derek Stegelman (@dstegelman), original author
5-
* Peter Bittner (@bittner), current maintainer
4+
* Peter Bittner (@bittner)
65

76
Contributors
87
------------
@@ -11,3 +10,10 @@ Contributors
1110
* Aaron VanDerlip (@aaronvanderlip)
1211
* Travis Swicegood (@tswicegood)
1312
* Pablo Castellano (@PabloCastellano)
13+
* Amit Kumar (@umrao-ak47)
14+
* Wolfgang Herget (@wherget)
15+
16+
Original Author
17+
---------------
18+
19+
* Derek Stegelman (@dstegelman)

MANIFEST.in

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
graft bootstrap/static
2+
graft fontawesome/static
3+
exclude .gitignore tox.ini
14
include README.rst
2-
recursive-include bootstrap/static *.*
3-
recursive-include fontawesome/static *.*
5+
prune .github
6+
prune tests

README.rst

+34-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Django Bootstrap Static Files |latest-version|
33
==============================================
44

5-
|bootstrap| |jquery| |fontawesome| |build-status|
5+
|bootstrap| |jquery| |fontawesome| |pipeline|
66

77
Bootstrap and optional Font Awesome static files ready for the picking.
88

@@ -20,9 +20,9 @@ Also ships the latest jQuery compatible with Bootstrap, for optional inclusion.
2020
.. |fontawesome| image:: https://img.shields.io/badge/Font_Awesome-v6.5.2-1c9a71.svg
2121
:alt: Font Awesome 6.5.2
2222
:target: https://fontawesome.com/icons?m=free
23-
.. |build-status| image:: https://img.shields.io/travis/bittner/django-bootstrap-static/master.svg?logo=travis
23+
.. |pipeline| image:: https://github.com/bittner/django-bootstrap-static/actions/workflows/pipeline.yml/badge.svg
2424
:alt: Build status
25-
:target: https://travis-ci.org/bittner/django-bootstrap-static
25+
:target: https://github.com/bittner/django-bootstrap-static/actions/workflows/pipeline.yml
2626

2727
Install
2828
=======
@@ -75,7 +75,7 @@ to save a few kilobytes of bandwidth.
7575

7676
More details on integration may be available from each of the two projects:
7777

78-
- https://getbootstrap.com/docs/5.0/getting-started/introduction/
78+
- https://getbootstrap.com/docs/5.3/getting-started/introduction/
7979
- https://fontawesome.com/get-started (`Upgrading from Version 4 of Font Awesome`_)
8080

8181
.. _Upgrading from Version 4 of Font Awesome:
@@ -91,18 +91,36 @@ Sources and Procedures
9191
----------------------
9292

9393
Bootstrap: (all files from dist package)
94-
`Bootstrap website / Download`_ -> drop into ``bootstrap/static/bootstrap/``
94+
`Bootstrap website / Download`_ drop into ``bootstrap/static/bootstrap/``
9595
jQuery: (compressed, uncompressed, map)
96-
`jQuery website / Download`_ -> rename and mix into ``bootstrap/static/bootstrap/js/``
96+
`jQuery website / Download`_ rename and mix into ``bootstrap/static/bootstrap/js/``
9797

9898
Pick the latest version denoted as a dependency in ``bower.json`` (see `Dependencies`_).
9999
Font Awesome: (content of the ``on-server/`` folder only)
100-
`Font Awesome website / Download Free`_ -> drop into ``fontawesome/static/fontawesome/``
100+
`Font Awesome website / Download Free`_ drop into ``fontawesome/static/fontawesome/``
101101

102-
.. _Bootstrap website / Download: https://getbootstrap.com/
103-
.. _jQuery website / Download: https://jquery.com/download/
104-
.. _Dependencies: https://getbootstrap.com/docs/5.0/getting-started/javascript/
105-
.. _Font Awesome website / Download Free: https://fontawesome.com/
102+
Tests
103+
-----
104+
105+
Tests are great! And necessary. Please, add more. More is better!
106+
We use `Tox`_.
107+
108+
.. code-block:: console
109+
110+
pip install tox
111+
112+
Run all the linting and tests locally using Tox like this:
113+
114+
.. code-block:: console
115+
116+
tox
117+
118+
.. code-block:: console
119+
120+
tox list
121+
tox -e package
122+
tox -e py310,clean
123+
tox -e format -- tests
106124
107125
Releases
108126
========
@@ -115,4 +133,9 @@ a new change within this package itself, e.g.
115133
``django-bootstrap-static==3.3.1.1`` == Bootstrap ``3.3.1`` with an additional
116134
package change.
117135

136+
.. _Bootstrap website / Download: https://getbootstrap.com/
137+
.. _jQuery website / Download: https://jquery.com/download/
138+
.. _Dependencies: https://getbootstrap.com/docs/5.0/getting-started/javascript/
139+
.. _Font Awesome website / Download Free: https://fontawesome.com/
140+
.. _Tox: https://tox.wiki/
118141
.. _semver: https://semver.org/

bootstrap/__init__.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""
2-
A collection of Bootstrap static files.
2+
A collection of Bootstrap static files. Font Awesome.
33
"""
4-
__author__ = 'Peter Bittner'
5-
__email__ = '[email protected]'
6-
__license__ = 'MIT'
7-
__url__ = 'https://github.com/bittner/django-bootstrap-static'
8-
__version__ = '5.3.3'
4+
5+
__version__ = "5.3.3"

fontawesome/__init__.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""
2-
A collection of Bootstrap static files.
2+
A collection of Bootstrap static files. Font Awesome.
33
"""
4-
__author__ = 'Peter Bittner'
5-
__email__ = '[email protected]'
6-
__license__ = 'MIT'
7-
__url__ = 'https://github.com/bittner/django-bootstrap-static'
8-
__version__ = '6.5.2'
4+
5+
__version__ = "6.5.2"

pyproject.toml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = ["setuptools>=64", "setuptools_scm>=8"]
4+
5+
[project]
6+
name = "django-bootstrap-static"
7+
dynamic = ["version"]
8+
description = "A collection of Bootstrap static files."
9+
readme = "README.rst"
10+
license = {file = "LICENSE"}
11+
authors = [
12+
{name = "Peter Bittner", email = "[email protected]"},
13+
]
14+
maintainers = [
15+
{name = "Peter Bittner", email = "[email protected]"},
16+
]
17+
classifiers = [
18+
"Development Status :: 5 - Production/Stable",
19+
"Environment :: Web Environment",
20+
"Intended Audience :: Developers",
21+
"Natural Language :: English",
22+
"Operating System :: OS Independent",
23+
"Framework :: Django",
24+
"Programming Language :: Python",
25+
"Programming Language :: Python :: 2",
26+
"Programming Language :: Python :: 3",
27+
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
28+
"Topic :: Utilities",
29+
"License :: OSI Approved :: MIT License",
30+
]
31+
keywords=[
32+
"django",
33+
"staticfiles",
34+
"bootstrap",
35+
"jquery",
36+
"fontawesome",
37+
]
38+
39+
[project.urls]
40+
source = "https://github.com/bittner/django-bootstrap-static"
41+
42+
[tool.pytest.ini_options]
43+
addopts = "--color=yes --doctest-modules --verbose"
44+
45+
[tool.ruff]
46+
extend-exclude = []
47+
extend-include = []
48+
49+
[tool.ruff.lint]
50+
extend-select = ["ALL"]
51+
extend-ignore = ["ANN", "D", "INP001", "UP"]
52+
53+
[tool.ruff.lint.per-file-ignores]
54+
"tests/*.py" = ["S101"]
55+
56+
[tool.setuptools]
57+
include-package-data = true
58+
packages = ["bootstrap", "fontawesome"]
59+
60+
[tool.setuptools_scm]
61+
local_scheme = "no-local-version"

setup.cfg

-2
This file was deleted.

setup.py

-43
This file was deleted.

0 commit comments

Comments
 (0)