Skip to content

Commit d2ef453

Browse files
authored
Merge pull request #253 from Mic92/new-packaging
package with pyproject.toml
2 parents 1a2106a + 6f6e543 commit d2ef453

26 files changed

+606
-495
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
exclude setup.cfg
21
include *.txt
32
include *.rst
43
recursive-include doc *.rst

Makefile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYTHON ?= python3.11
1+
PYTHON ?= python3.13
22
REMOTE = git@github.com:Mic92/python-mpd2
33
VERSION = $(shell $(PYTHON) -c "import mpd; print('.'.join(map(str,mpd.VERSION)))")
44

@@ -7,12 +7,25 @@ test:
77
release: test
88
test "$(shell git symbolic-ref --short HEAD)" = "master" || (echo "not on master branch"; exit 1)
99
git pull --rebase origin master
10-
$(PYTHON) setup.py sdist bdist_wheel
11-
$(PYTHON) -m twine check dist/python-mpd2-$(VERSION).tar.gz dist/python_mpd2-$(VERSION)-py2.py3-none-any.whl
10+
$(PYTHON) -m build
11+
$(PYTHON) -m twine check dist/python-mpd2-$(VERSION).tar.gz dist/python_mpd2-$(VERSION)-py3-none-any.whl
1212
git tag "v$(VERSION)"
1313
git push --tags git@github.com:Mic92/python-mpd2 "v$(VERSION)"
14-
$(PYTHON) -m twine upload --repository python-mpd2 dist/python-mpd2-$(VERSION).tar.gz dist/python_mpd2-$(VERSION)-py2.py3-none-any.whl
14+
$(PYTHON) -m twine upload --repository python-mpd2 dist/python-mpd2-$(VERSION).tar.gz dist/python_mpd2-$(VERSION)-py3-none-any.whl
1515
clean:
16-
$(PYTHON) setup.py clean
16+
rm -rf dist build *.egg-info
1717

18-
.PHONY: test release clean
18+
bump-version:
19+
@if [ -z "$(NEW_VERSION)" ]; then \
20+
echo "Usage: make bump-version NEW_VERSION=x.y.z"; \
21+
exit 1; \
22+
fi
23+
@echo "Bumping version to $(NEW_VERSION)..."
24+
@# Convert x.y.z to (x, y, z) for mpd/base.py
25+
@VERSION_TUPLE=$$(echo "$(NEW_VERSION)" | sed 's/\./,\ /g'); \
26+
sed -i.bak "s/^VERSION = (.*/VERSION = ($$VERSION_TUPLE)/" mpd/base.py && rm mpd/base.py.bak
27+
@# Update version in pyproject.toml
28+
@sed -i.bak 's/^version = .*/version = "$(NEW_VERSION)"/' pyproject.toml && rm pyproject.toml.bak
29+
@echo "Version bumped to $(NEW_VERSION)"
30+
31+
.PHONY: test release clean bump-version

bors.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/conf.py

Lines changed: 76 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import sys
15+
import os
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
@@ -22,27 +23,27 @@
2223
# -- General configuration -----------------------------------------------------
2324

2425
# If your documentation needs a minimal Sphinx version, state it here.
25-
#needs_sphinx = '1.0'
26+
# needs_sphinx = '1.0'
2627

2728
# Add any Sphinx extension module names here, as strings. They can be extensions
2829
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29-
extensions = ['sphinx.ext.viewcode']
30+
extensions = ["sphinx.ext.viewcode"]
3031

3132
# Add any paths that contain templates here, relative to this directory.
32-
templates_path = ['_templates']
33+
templates_path = ["_templates"]
3334

3435
# The suffix of source filenames.
35-
source_suffix = '.rst'
36+
source_suffix = ".rst"
3637

3738
# The encoding of source files.
38-
#source_encoding = 'utf-8-sig'
39+
# source_encoding = 'utf-8-sig'
3940

4041
# The master toctree document.
41-
master_doc = 'index'
42+
master_doc = "index"
4243

4344
# General information about the project.
44-
project = u'python-mpd2'
45-
copyright = u'2013, Jörg Thalheim'
45+
project = "python-mpd2"
46+
copyright = "2013, Jörg Thalheim"
4647

4748
# The version info for the project you're documenting, acts as replacement for
4849
# |version| and |release|, also used in various other places throughout the
@@ -55,174 +56,176 @@
5556

5657
# The language for content autogenerated by Sphinx. Refer to documentation
5758
# for a list of supported languages.
58-
#language = None
59+
# language = None
5960

6061
# There are two options for replacing |today|: either, you set today to some
6162
# non-false value, then it is used:
62-
#today = ''
63+
# today = ''
6364
# Else, today_fmt is used as the format for a strftime call.
64-
#today_fmt = '%B %d, %Y'
65+
# today_fmt = '%B %d, %Y'
6566

6667
# List of patterns, relative to source directory, that match files and
6768
# directories to ignore when looking for source files.
68-
exclude_patterns = ['_build']
69+
exclude_patterns = ["_build"]
6970

7071
# The reST default role (used for this markup: `text`) to use for all documents.
71-
#default_role = None
72+
# default_role = None
7273

7374
# If true, '()' will be appended to :func: etc. cross-reference text.
74-
#add_function_parentheses = True
75+
# add_function_parentheses = True
7576

7677
# If true, the current module name will be prepended to all description
7778
# unit titles (such as .. function::).
78-
#add_module_names = True
79+
# add_module_names = True
7980

8081
# If true, sectionauthor and moduleauthor directives will be shown in the
8182
# output. They are ignored by default.
82-
#show_authors = False
83+
# show_authors = False
8384

8485
# The name of the Pygments (syntax highlighting) style to use.
85-
pygments_style = 'sphinx'
86+
pygments_style = "sphinx"
8687

8788
# A list of ignored prefixes for module index sorting.
88-
#modindex_common_prefix = []
89+
# modindex_common_prefix = []
8990

9091
# If true, keep warnings as "system message" paragraphs in the built documents.
91-
#keep_warnings = False
92+
# keep_warnings = False
9293

9394

9495
# -- Options for HTML output ---------------------------------------------------
9596

9697
# The theme to use for HTML and HTML Help pages. See the documentation for
9798
# a list of builtin themes.
98-
html_theme = 'default'
99+
html_theme = "default"
99100

100101
# Theme options are theme-specific and customize the look and feel of a theme
101102
# further. For a list of options available for each theme, see the
102103
# documentation.
103-
#html_theme_options = {}
104+
# html_theme_options = {}
104105

105106
# Add any paths that contain custom themes here, relative to this directory.
106-
#html_theme_path = []
107+
# html_theme_path = []
107108

108109
# The name for this set of Sphinx documents. If None, it defaults to
109110
# "<project> v<release> documentation".
110-
#html_title = None
111+
# html_title = None
111112

112113
# A shorter title for the navigation bar. Default is the same as html_title.
113-
#html_short_title = None
114+
# html_short_title = None
114115

115116
# The name of an image file (relative to this directory) to place at the top
116117
# of the sidebar.
117-
#html_logo = None
118+
# html_logo = None
118119

119120
# The name of an image file (within the static path) to use as favicon of the
120121
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
121122
# pixels large.
122-
#html_favicon = None
123+
# html_favicon = None
123124

124125
# Add any paths that contain custom static files (such as style sheets) here,
125126
# relative to this directory. They are copied after the builtin static files,
126127
# so a file named "default.css" will overwrite the builtin "default.css".
127-
html_static_path = ['_static']
128+
html_static_path = ["_static"]
128129

129130
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
130131
# using the given strftime format.
131-
#html_last_updated_fmt = '%b %d, %Y'
132+
# html_last_updated_fmt = '%b %d, %Y'
132133

133134
# If true, SmartyPants will be used to convert quotes and dashes to
134135
# typographically correct entities.
135-
#html_use_smartypants = True
136+
# html_use_smartypants = True
136137

137138
# Custom sidebar templates, maps document names to template names.
138-
#html_sidebars = {}
139+
# html_sidebars = {}
139140

140141
# Additional templates that should be rendered to pages, maps page names to
141142
# template names.
142-
#html_additional_pages = {}
143+
# html_additional_pages = {}
143144

144145
# If false, no module index is generated.
145-
#html_domain_indices = True
146+
# html_domain_indices = True
146147

147148
# If false, no index is generated.
148-
#html_use_index = True
149+
# html_use_index = True
149150

150151
# If true, the index is split into individual pages for each letter.
151-
#html_split_index = False
152+
# html_split_index = False
152153

153154
# If true, links to the reST sources are added to the pages.
154-
#html_show_sourcelink = True
155+
# html_show_sourcelink = True
155156

156157
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
157-
#html_show_sphinx = True
158+
# html_show_sphinx = True
158159

159160
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
160-
#html_show_copyright = True
161+
# html_show_copyright = True
161162

162163
# If true, an OpenSearch description file will be output, and all pages will
163164
# contain a <link> tag referring to it. The value of this option must be the
164165
# base URL from which the finished HTML is served.
165-
#html_use_opensearch = ''
166+
# html_use_opensearch = ''
166167

167168
# This is the file name suffix for HTML files (e.g. ".xhtml").
168-
#html_file_suffix = None
169+
# html_file_suffix = None
169170

170171
# Output file base name for HTML help builder.
171-
htmlhelp_basename = 'python-mpd2doc'
172+
htmlhelp_basename = "python-mpd2doc"
172173

173174

174175
# -- Options for LaTeX output --------------------------------------------------
175176

176177
latex_elements = {
177-
# The paper size ('letterpaper' or 'a4paper').
178-
#'papersize': 'letterpaper',
179-
180-
# The font size ('10pt', '11pt' or '12pt').
181-
#'pointsize': '10pt',
182-
183-
# Additional stuff for the LaTeX preamble.
184-
#'preamble': '',
178+
# The paper size ('letterpaper' or 'a4paper').
179+
#'papersize': 'letterpaper',
180+
# The font size ('10pt', '11pt' or '12pt').
181+
#'pointsize': '10pt',
182+
# Additional stuff for the LaTeX preamble.
183+
#'preamble': '',
185184
}
186185

187186
# Grouping the document tree into LaTeX files. List of tuples
188187
# (source start file, target name, title, author, documentclass [howto/manual]).
189188
latex_documents = [
190-
('index', 'python-mpd2.tex', u'python-mpd2 Documentation',
191-
u'Jörg Thalheim', 'manual'),
189+
(
190+
"index",
191+
"python-mpd2.tex",
192+
"python-mpd2 Documentation",
193+
"Jörg Thalheim",
194+
"manual",
195+
),
192196
]
193197

194198
# The name of an image file (relative to this directory) to place at the top of
195199
# the title page.
196-
#latex_logo = None
200+
# latex_logo = None
197201

198202
# For "manual" documents, if this is true, then toplevel headings are parts,
199203
# not chapters.
200-
#latex_use_parts = False
204+
# latex_use_parts = False
201205

202206
# If true, show page references after internal links.
203-
#latex_show_pagerefs = False
207+
# latex_show_pagerefs = False
204208

205209
# If true, show URL addresses after external links.
206-
#latex_show_urls = False
210+
# latex_show_urls = False
207211

208212
# Documents to append as an appendix to all manuals.
209-
#latex_appendices = []
213+
# latex_appendices = []
210214

211215
# If false, no module index is generated.
212-
#latex_domain_indices = True
216+
# latex_domain_indices = True
213217

214218

215219
# -- Options for manual page output --------------------------------------------
216220

217221
# One entry per manual page. List of tuples
218222
# (source start file, name, description, authors, manual section).
219223
man_pages = [
220-
('index', 'python-mpd2', u'python-mpd2 Documentation',
221-
[u'Jörg Thalheim'], 1)
224+
("index", "python-mpd2", "python-mpd2 Documentation", ["Jörg Thalheim"], 1)
222225
]
223226

224227
# If true, show URL addresses after external links.
225-
#man_show_urls = False
228+
# man_show_urls = False
226229

227230

228231
# -- Options for Texinfo output ------------------------------------------------
@@ -231,19 +234,25 @@
231234
# (source start file, target name, title, author,
232235
# dir menu entry, description, category)
233236
texinfo_documents = [
234-
('index', 'python-mpd2', u'python-mpd2 Documentation',
235-
u'Jörg Thalheim', 'python-mpd2', 'One line description of project.',
236-
'Miscellaneous'),
237+
(
238+
"index",
239+
"python-mpd2",
240+
"python-mpd2 Documentation",
241+
"Jörg Thalheim",
242+
"python-mpd2",
243+
"One line description of project.",
244+
"Miscellaneous",
245+
),
237246
]
238247

239248
# Documents to append as an appendix to all manuals.
240-
#texinfo_appendices = []
249+
# texinfo_appendices = []
241250

242251
# If false, no module index is generated.
243-
#texinfo_domain_indices = True
252+
# texinfo_domain_indices = True
244253

245254
# How to display URL addresses: 'footnote', 'no', or 'inline'.
246-
#texinfo_show_urls = 'footnote'
255+
# texinfo_show_urls = 'footnote'
247256

248257
# If true, do not generate a @detailmenu in the "Top" node's menu.
249-
#texinfo_no_detailmenu = False
258+
# texinfo_no_detailmenu = False

0 commit comments

Comments
 (0)