Skip to content

Commit ea6e2f5

Browse files
committed
Continue migration to more modern practices
1 parent 9057d75 commit ea6e2f5

File tree

9 files changed

+157
-181
lines changed

9 files changed

+157
-181
lines changed

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ TurboGears 2 DevTools
44

55
[![Build Status](https://img.shields.io/travis/TurboGears/tg2devtools.svg)](https://travis-ci.org/TurboGears/tg2devtools)
66
[![PyPI version](https://img.shields.io/pypi/v/tg.devtools.svg)](https://pypi.org/project/tg.devtools)
7-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.txt)
88

99
TurboGears 2 DevTools is a command-line toolkit that streamlines the development of TurboGears2 applications.
1010
Built on top of Gearbox, it helps you quickly scaffold new full-stack projects, generate extensions,
11-
manage database migrations, and launch interactive shellsall from one unified interface.
11+
manage database migrations, and launch interactive shells all from one unified interface.
1212

1313
Key Features
1414
------------
@@ -43,6 +43,7 @@ Use the quickstart command to generate a new TurboGears2 full-stack application:
4343
gearbox quickstart myproject
4444

4545
This creates a ready-to-run project with a standard directory structure and preconfigured settings.
46+
To start the newly created web application, follow the instructions in the project ``README.rst`` file.
4647

4748
Usage Examples
4849
--------------
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Quickstarted Options:
2+
#
3+
# sqlalchemy: {{sqlalchemy}}
4+
# auth: {{auth}}
5+
# mako: {{mako}}
6+
7+
[build-system]
8+
requires = ["setuptools>=61.0", "wheel"]
9+
build-backend = "setuptools.build_meta"
10+
11+
[project]
12+
name = "{{project}}"
13+
version = "0.1"
14+
description = ""
15+
authors = [
16+
{ name = "Uknown", email = "[email protected]" }
17+
]
18+
urls = { Homepage = "http://unknown.org" }
19+
readme = { file = "README.rst", content-type = "text/x-rst" }
20+
dependencies = [
21+
"TurboGears2 >= 2.4.3",
22+
"Beaker >= 1.8.0",
23+
{{if kajiki}}
24+
"Kajiki >= 0.6.3",
25+
{{endif}}
26+
{{if genshi}}
27+
"Genshi",
28+
{{endif}}
29+
{{if mako}}
30+
"Mako",
31+
{{endif}}
32+
{{if sqlalchemy}}
33+
"zope.sqlalchemy >= 1.2",
34+
"sqlalchemy < 3.0",
35+
{{endif}}
36+
{{if sqlalchemy and migrations}}
37+
"alembic",
38+
{{endif}}
39+
{{if ming}}
40+
"ming>=0.4.3",
41+
{{endif}}
42+
{{if auth}}
43+
"repoze.who",
44+
{{endif}}
45+
"WebHelpers2",
46+
"Babel > 2.12",
47+
{{if jinja}}
48+
"jinja2",
49+
{{endif}}
50+
]
51+
52+
[project.optional-dependencies]
53+
testing = [
54+
"WebTest >= 1.2.3",
55+
"pytest",
56+
"coverage",
57+
"gearbox"
58+
]
59+
60+
[tool.setuptools]
61+
include-package-data = true
62+
zip-safe = false
63+
64+
[tool.setuptools.packages.find]
65+
exclude = []
66+
67+
[tool.setuptools.package-data]
68+
{{package}} = [
69+
"i18n/*/LC_MESSAGES/*.mo",
70+
"templates/*/*",
71+
"public/*/*"
72+
]
73+
74+
[tool.babel]
75+
domain = "{{package}}"
76+
77+
[[tool.babel.mappings]]
78+
method = "python"
79+
pattern = "**.py"
80+
81+
[[tool.babel.mappings]]
82+
method = "ignore"
83+
pattern = "public/**"
84+
85+
{{if mako}}
86+
[[tool.babel.mappings]]
87+
method = "mako"
88+
pattern = "**/templates/**.mak"
89+
{{endif}}
90+
91+
{{if kajiki}}
92+
[[tool.babel.mappings]]
93+
method = "kajiki"
94+
pattern = "templates/**.xhtml"
95+
96+
[tool.babel.mappings.options]
97+
strip_text = false
98+
extract_python = true
99+
{{endif}}
100+
101+
{{if jinja}}
102+
[[tool.babel.mappings]]
103+
method = "jinja2"
104+
pattern = "templates/**.jinja"
105+
{{endif}}
106+
107+
{{if genshi}}
108+
[[tool.babel.mappings]]
109+
method = "genshi"
110+
pattern = "templates/**.html"
111+
{{endif}}
112+
113+
[project.entry-points."paste.app_factory"]
114+
main = "{{package}}.config.application:make_app"
115+
116+
[project.entry-points."gearbox.plugins"]
117+
turbogears-devtools = "tg.devtools"
Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
[nosetests]
2-
verbosity = 2
3-
detailed-errors = 1
4-
with-coverage = false
5-
cover-erase = true
6-
cover-package = {{package}}
7-
81
# Babel configuration
92
[compile_catalog]
103
domain = {{package}}
@@ -16,6 +9,7 @@ add_comments = TRANSLATORS:
169
output_file = {{package}}/i18n/{{package}}.pot
1710
width = 80
1811
keywords = l_
12+
mapping_file = pyproject.toml
1913

2014
[init_catalog]
2115
domain = {{package}}
@@ -28,22 +22,3 @@ input_file = {{package}}/i18n/{{package}}.pot
2822
output_dir = {{package}}/i18n
2923
previous = true
3024

31-
# Static files extraction for TW
32-
[archive_tw_resources]
33-
output = {{package}}/public/toscawidgets/
34-
distributions = {{package}}
35-
#yuicompressor = /home/someuser/bin/yuicompressor.jar
36-
#compresslevel = 2
37-
onepass = true
38-
39-
[archive_tw2_resources]
40-
output = {{package}}/public/tw2/
41-
distributions = {{package}}
42-
force = true
43-
#yuicompressor = /home/someuser/bin/yuicompressor.jar
44-
#compresslevel = 2
45-
onepass = true
46-
47-
[aliases]
48-
# A handy alias to make a release to pypi
49-
release = egg_info -RDb "" sdist bdist_egg register upload
Lines changed: 3 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
from setuptools import setup
22

3-
# Quickstarted Options:
4-
#
5-
# sqlalchemy: {{sqlalchemy}}
6-
# auth: {{auth}}
7-
# mako: {{mako}}
8-
#
9-
#
10-
11-
# This is just a work-around for a Python2.7 issue causing
12-
# interpreter crash at exit when trying to log an info message.
13-
try:
14-
import logging
15-
import multiprocessing
16-
except:
17-
pass
18-
19-
import sys
20-
py_version = sys.version_info[:2]
21-
22-
try:
23-
from setuptools import setup, find_packages
24-
except ImportError:
25-
from ez_setup import use_setuptools
26-
use_setuptools()
27-
from setuptools import setup, find_packages
28-
29-
testpkgs = [
30-
'WebTest >= 1.2.3',
31-
'pytest',
32-
'coverage',
33-
'gearbox'
34-
]
35-
36-
install_requires = [
37-
"TurboGears2 >= 2.4.3",
38-
"Beaker >= 1.8.0",
39-
{{if kajiki}}
40-
"Kajiki >= 0.6.3",
41-
{{endif}}
42-
{{if genshi}}
43-
"Genshi",
44-
{{endif}}
45-
{{if mako}}
46-
"Mako",
47-
{{endif}}
48-
{{if sqlalchemy}}
49-
"zope.sqlalchemy >= 1.2",
50-
"sqlalchemy < 3.0",
51-
{{endif}}
52-
{{if sqlalchemy and migrations}}
53-
"alembic",
54-
{{endif}}
55-
{{if ming}}
56-
"ming>=0.4.3",
57-
{{endif}}
58-
{{if auth}}
59-
"repoze.who",
60-
{{endif}}
61-
"WebHelpers2"
62-
]
63-
64-
if py_version != (3, 2):
65-
# Babel not available on 3.2
66-
install_requires.append("Babel")
67-
68-
{{if jinja}}
69-
if py_version == (3, 2):
70-
# jinja2 2.7 is incompatible with Python 3.2
71-
install_requires.append('jinja2 < 2.7')
72-
else:
73-
install_requires.append('jinja2')
74-
{{endif}}
75-
76-
setup(
77-
name='{{project}}',
78-
version='0.1',
79-
description='',
80-
author='',
81-
author_email='',
82-
url='',
83-
packages=find_packages(exclude=['ez_setup']),
84-
install_requires=install_requires,
85-
include_package_data=True,
86-
extras_require={
87-
'testing': testpkgs
88-
},
89-
package_data={'{{package}}': [
90-
'i18n/*/LC_MESSAGES/*.mo',
91-
'templates/*/*',
92-
'public/*/*'
93-
]},
94-
message_extractors={'{{package}}': [
95-
('**.py', 'python', None),
96-
{{if mako}}
97-
('templates/**.mak', 'mako', None),
98-
{{endif}}
99-
{{if kajiki}}
100-
('templates/**.xhtml', 'kajiki', {'strip_text': False, 'extract_python': True}),
101-
{{endif}}
102-
{{if jinja}}
103-
('templates/**.jinja', 'jinja2', None),
104-
{{endif}}
105-
{{if genshi}}
106-
('templates/**.html', 'genshi', None),
107-
{{endif}}
108-
{{babel_templates_extractor}}('public/**', 'ignore', None)
109-
]},
110-
entry_points={
111-
'paste.app_factory': [
112-
'main = {{package}}.config.application:make_app'
113-
],
114-
'gearbox.plugins': [
115-
'turbogears-devtools = tg.devtools'
116-
]
117-
},
118-
zip_safe=False
119-
)
3+
if __name__ == "__main__":
4+
setup()

devtools/gearbox/tgext/template/LICENSE_tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 {{author}}
3+
Copyright (c) {{author}}
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

devtools/gearbox/tgext/template/README.rst_tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
About {{package}}
2-
-------------------------
1+
{{package}}
2+
===========
33

44
{{package}} is a TurboGears2 extension
55

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = {{repr(package)}}
7+
version = "{{version}}"
8+
description = "{{description or ''}}"
9+
readme = { file = "README.rst", content-type = "text/x-rst" }
10+
classifiers = [] # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
11+
keywords = {{repr(keywords or '')}}
12+
authors = [
13+
{ name = {{repr(author or '')}}, email = {{repr(author_email or '')}} }
14+
]
15+
urls = { Homepage = {{repr(url or '')}} }
16+
license = { text = {{repr(license_name or '')}} }
17+
dependencies = [
18+
"TurboGears2 >= 2.5.0"
19+
]
20+
21+
[tool.setuptools.packages.find]
22+
exclude = ["ez_setup", "examples", "tests"]
23+
24+
[tool.setuptools]
25+
include-package-data = true
26+
zip-safe = false
27+
namespace_packages = ["tgext"]
Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,4 @@
1-
from setuptools import setup, find_packages
2-
import sys, os
1+
from setuptools import setup
32

4-
here = os.path.abspath(os.path.dirname(__file__))
5-
try:
6-
README = open(os.path.join(here, 'README.rst')).read()
7-
except IOError:
8-
README = ''
9-
10-
version = "{{version}}"
11-
12-
setup(
13-
name={{repr(package)}},
14-
version=version,
15-
description="{{description or ''}}",
16-
long_description=README,
17-
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
18-
keywords={{repr(keywords or '')}},
19-
author={{repr(author or '')}},
20-
author_email={{repr(author_email or '')}},
21-
url={{repr(url or '')}},
22-
license={{repr(license_name or '')}},
23-
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
24-
namespace_packages = ['tgext'],
25-
include_package_data=True,
26-
zip_safe=False,
27-
install_requires=[
28-
"TurboGears2 >= 2.4.3",
29-
],
30-
entry_points="""
31-
# -*- Entry points: -*-
32-
"""
33-
)
3+
if __name__ == "__main__":
4+
setup()

0 commit comments

Comments
 (0)