|
|
Mads Kiilerich
|
0a9ddb8cd8c1
|
3 years ago
|
|
setup: avoid setuptools 67 - it can't handle celery's broken pytz dependency With setuptools 67 or later, launching Kallithea fails as: $ gearbox serve -c my.ini --reload 15:56:54,111 ERROR [gearbox] Expected closing RIGHT_PARENTHESIS pytz (>dev) ~^ The `packaging` vendored in setuptools cannot handle the broken syntax `Requires-Dist: pytz (>dev)` in venv/lib/python3.11/site-packages/celery-5.0.5.dist-info/METADATA . The old celery version currently used by Kallithea is wrong, and setuptools has moved on after a reasonable grace period. We thus have to work around and avoid latest setuptools. See https://github.com/pypa/setuptools/issues/3889 .
|
|
|
Mads Kiilerich
|
4f0de9468da3
|
5 years ago
|
|
controllers: move controllers base class from lib/base to controllers
TG quickstart put it in lib/base.py , but it fits better on the controllers layer as a base there.
The contributing docs were a bit ahead of time ... but with a typo.
|
|
|
Mads Kiilerich
|
52816813cbec
|
5 years ago
|
|
docs: describe, visualize, and verify internal code structure and layering
Try to describe something that isn't entirely there yet.
deps.py will help track and minimize violations through checks and visualization in deps.svg .
|
|
|
Thomas De Schampheleire
|
26fcb8c16c2c
|
5 years ago
|
|
docs/contributing: wrap long line
Forgotten review comment.
|
|
|
Thomas De Schampheleire
|
a47f8f57b347
|
5 years ago
|
|
|
|
|
Thomas De Schampheleire
|
5a3417b6fcf2
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
6bab917402b4
|
5 years ago
|
|
docs: when using venv with a clone, recommend using 'venv' as location
Avoid having the odd inconsistent location ../kallithea-venv to care about.
For good or bad, this might change how it is feasible to grep. I usually make sure to only search tracked files: grep Foo `hg mani`
|
|
|
Thomas De Schampheleire
|
91dcc7be201c
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
fc54d9d65006
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
3c503044e9f1
|
5 years ago
|
|
mysql: bump sqlalchemy.url MariaDB/MySQL charset to to 'utf8mb4' to get full UTF-8 support The change in 210e76d69b62 only changed character_set_database, as shown by output after: --- a/kallithea/model/base.py +++ b/kallithea/model/base.py @@ -46,3 +46,8 @@ def init_model(engine): engine_str = obfuscate_url_pw(str(engine.url)) log.info("initializing db for %s", engine_str) meta.Base.metadata.bind = engine + + meta.Session.configure(bind=engine) + for a, b in meta.Session().execute('''show variables''').fetchall(): + if 'character_set_' in a: + print(a, repr(b)) Before, with charset=utf8, the utf8mb3 charset was used all the way through the stack: [kallithea.model.base] initializing db for mysql://kallithea-test:XXXXX@localhost/kallithea-test?charset=utf8 character_set_client 'utf8' character_set_connection 'utf8' character_set_database 'utf8mb4' character_set_filesystem 'binary' character_set_results 'utf8' character_set_server 'latin1' character_set_system 'utf8' With explicit charset=utf8mb4: [kallithea.model.base] initializing db for mysql://kallithea-test:XXXXX@localhost/kallithea-test?charset=utf8mb4 character_set_client 'utf8mb4' character_set_connection 'utf8mb4' character_set_database 'utf8mb4' character_set_filesystem 'binary' character_set_results 'utf8mb4' character_set_server 'latin1' character_set_system 'utf8'
|
|
|
Mads Kiilerich
|
922808a61274
|
5 years ago
|
|
tests: introduce REUSE_TEST_DB as an alternative to TEST_DB
With TEST_DB, the specified database would be dropped (if existing) and created from scratch. That would fail if the user only had been granted access to that database without general database creation permissions.
With REUSE_TEST_DB, the database must exist, and the tables in the existing database will be deleted before creating the new ones.
This is for example useful for testing on PostgreSQL without full database privileges. (With MariaDB/MySQL, it is possible to grant create permissions to a database before it exists, so it is easier to use TEST_DB.)
|
|
|
Mads Kiilerich
|
3b1c53643b09
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
4869a8bb1237
|
6 years ago
|
|
ini: tweak template configuration for TG's handling of application errors
Mention what was learned while debugging request processing at WSGI/TG level and the complexity of the TG stack gets in the way.
|
|
|
Mads Kiilerich
|
2b8892f92b46
|
6 years ago
|
|
docs: fix contributing.rst reference to Session.remove() (Second to) last example of Session.remove was removed in 1a409593f352.
|
|
|
Mads Kiilerich
|
01aca0a4f876
|
6 years ago
|
|
py3: officially support Python 3
All tests pass and no known regressions.
|
|
|
Mads Kiilerich
|
89e9aef9b983
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
3a3d96dbd445
|
6 years ago
|
|
docs: clean up installation of optional dependencies
Install them together with Kallithea, to make things simpler, and make sure all constraints are handled correctly.
|
|
|
Mads Kiilerich
|
d9e37f7fd35b
|
6 years ago
|
|
docs: always use dev_requirements.txt together with main version constraints in setup.py
pip isn't good at considering old constraints when installing or updating packages later. Instead, install everything at once.
Note: pip and setuptools are usually installed automatically and could perhaps be removed from documentation. But for now, let's keep it.
|
|
|
Mads Kiilerich
|
ab30729c735c
|
7 years ago
|
|
setup: drop support for Python 2.6
It would be a a stepping stone for the migration to Python 3 to only support Python 2.7. Even though we don't make any big changes now, it might allow us to remove some workarounds or use some new forward-compatible features.
Mercurial dropped support for Python 2.6 2 years ago.
|
|
|
Thomas De Schampheleire
|
19af3fef3b34
|
7 years ago
|
|
|
|
|
Thomas De Schampheleire
|
b66725ba01ed
|
7 years ago
|
|
cli: add command 'kallithea-cli front-end-build'
Kallithea is under the GPL license, and we can thus only distribute any generated code if we also ship the corresponding source.
We are moving towards a web front-end that use npm to download and compile various open source components. The components might not be GPL, but if we distribute any parts of their code (compiled or converted to other representation), then we also must distribute the corresponding source under the GPL.
It doesn't seem feasible for us to distribute the source of everything that npm downloads and includes when we are building. It thus also doesn't seem feasible for us to build and ship the compiled (possibly minified) front-end code. Instead, we have to make it as smooth as possible for our users to get up and running.
It doesn't seem feasible for us to ship or install npm. We must assume it is available. That requirement must be documented clearly, and we must recommend how to install npm for the most common platforms.
We could perhaps just document what manual steps to run. Kallithea doesn't work out of the box anyway - it has to be configured and initialized. Extra steps might not be a big problem.
Another approach is to call out to npm while pip is installing Kallithea and download the requirements and build the files. It can be done by customizing setuptools commands in setup.py. But: Python packaging is fragile. Even though we only support pip, it really isn't built for things like this. Custom output is muted and buffered and only shown if running with -v or the command fails. And pip and setup.py can be used to build and install in so many ways that we probably can't make it work reliably with all ways of installing Kallithea.
The approach implemented by this commit is to add a custom cli command 'front-end-build' to run the required commands. This single user-facing command can internally run various steps as needed. The only current requirement is the presence of npm and an internet connection.
For now, this will just create/update style.css ... but currently probably without any actual changes. The files created by npm (and the node_modules directory) must *not* be a part of the release package made with 'setup.py sdist'.
(Commit message is mostly written by Mads Kiilerich)
|
|
|
Thomas De Schampheleire
|
3158cf0dafb7
|
7 years ago
|
|
|
|
|
Thomas De Schampheleire
|
7784a1212471
|
7 years ago
|
|
cli: convert 'gearbox make-config' into 'kallithea-cli config-create'
... and update documentation.
|
|
|
Mads Kiilerich
|
451b3f9d814e
|
7 years ago
|
|
docs: update i18n doc after TG migration changed lang to i18n.lang and test.ini is generated
These descriptions are not elegant, but now we make them less wrong.
|
|
|
domruf
|
1969f7dfb6b0
|
8 years ago
|
|
move package.json to root directory
In the future we'll probably use it to manage more then just less/css stuff. So the less directory is the wrong place. The most common place is the root directory, so lets put it there. Also, this way the --prefix parameter for npm is no longer required.
|
|
|
domruf
|
6ef837acb0d2
|
8 years ago
|
|
less: don't distribute the generated style.css file - for now, it must be built with npm after installing Kallithea
Generated files should not be included in the repository. Especially not when using GPL with the requirement of distributing corresponding source.
Also add the two commands to generate the css file to the docs.
Modified by Mads Kiilerich.
|
|
|
Andrew Shadura
|
84d8cff41282
|
8 years ago
|
|
|
|
|
Thomas De Schampheleire
|
29e9cb56f26f
|
8 years ago
|
|
docs: recommend --upgrade for all pip installations in a virtualenv
As suggested by Mads Kiilerich.
Don't recommend this practice when no virtualenv is used, i.e. root installation or --user installation: in this case upgrading existing packages may be too disruptive. The user can still add it manually if he so chooses.
|
|
|
Thomas De Schampheleire
|
a755bacaa725
|
8 years ago
|
|
|
|
|
Thomas De Schampheleire
|
1daec1628e0b
|
8 years ago
|
|
docs/contributing: move installation of dev_requirements to default instructions
When intending to contribute to Kallithea, you are expected to run all tests, so installation of the dev_requirements are actually mandatory. Hence, update the instructions.
|
|
|
Karl Goetz
|
49be3b49c8e2
|
8 years ago
|
|
docs/contributing: make contribution information more accessible
Try to make the contribution information more accessible to new users, by giving a bit more detail about the different steps in making contributions.
Some rework of the original patch done by Thomas De Schampheleire: - don't give the impression that Bitbucket is mandatory - don't recommend creating feature branches for regular development - reword/cross-reference section on contribution flow
|
|
|
Thomas De Schampheleire
|
043621a79cdb
|
8 years ago
|
|
docs: mention pytest-profiling
Could be useful for analysis of performance problems.
|
|
|
Eivind Tagseth
|
813e1f9d9c53
|
8 years ago
|
|
tests: add simple (skipped) unit tests for graph_data that may be used to measure performance
Modified by Thomas De Schampheleire to have performance tests in a separate directory so it is easier to run them, and also added some documentation.
|
|
|
Mads Kiilerich
|
2db16cda05ba
|
9 years ago
|
|
docs: clarify that Session usually should be called - methods should not be used directly
Documentation based on clarification by Søren Løvborg:
Session is the factory/singleton manager, which tracks the current session (per thread). To end the current session entirely and destroy the Session object, we call remove on the manager (Session.remove()). (A new session will be created on-demand.)
Session() returns the current session for the active thread (or creates a new session, if there's none). commit is a method of the SQLAlchemy Session class, thus called as Session().commit() ... it's a method call on the current Session object, not the session factory/manager.
SQLAlchemy may have some hackery to allow Session.commit() to be called, and the call automatically redirect to the actual Session object... but that's a hack and should be avoided.
TL;DR: for remove, call it on Session; for everything else, call it on Session().
|
|
|
Mads Kiilerich
|
b777b096d9a2
|
9 years ago
|
|
setup: don't use setuptools 34 - it has indirect conflicts with the celery version supported on the stable branch (Issue #266)
Setuptools==34 requires packaging>=16.8 which has an unconstrained requirement of pyparsing ... but actually it doesn't work with pyparsing==1.5.7 ... which is required by celery<2.3 ... which this version of Kallithea requires.
Celery has been upgraded on the development branch but we don't want to do that on the stable branch.
|
|
|
domruf
|
3af2dea756db
|
9 years ago
|
|
|
|
|
Thomas De Schampheleire
|
908e186abd8d
|
9 years ago
|
|
backend: add TurboGears2 DebugBar support
DebugBar is a toolbar overlayed over the Kallithea web interface, allowing you to see:
* timing information of the current request, including profiling information * request data, including GET data, POST data, cookies, headers and environment variables * a list of executed database queries, including timing and result values
Enable it automatically when in debug mode and all requirements are met. Add documentation.
|
|
|
Mads Kiilerich
|
213085032127
|
9 years ago
|
|
gearbox: make a make-config sub-command available again
Drop the old kallithea-config command line tool and rework it to a replacement for the make-config paster command. Make-config was experimental in paste, it doesn't exist with gearbox, it was tied to pylons, and we already have the luxury problem of having two ways of doing almost the same thing. This is a good opportunity to get rid of one of them.
This replacement tool is Kallithea specific and doesn't need to be told that it is Kallithea it has to create a config file for. The command should thus perhaps be given a Kallithea specific name instead of the very generic name ...
|
|
|
Mads Kiilerich
|
2c3d30095d5e
|
9 years ago
|
|
gearbox: replace paster with something TurboGears2-ish that still works with the Pylons stack
This is a step towards moving away from the Pylons stack to TurboGears2, but still independent of it.
Some notes from the porting - it could perhaps be the missing(?) documentation for migrating from paster to gearbox:
Note: 'gearbox' without parameters will crash - specify '-h' to get started testing.
Replace paster summary = 'yada yada' with the first line of the docstring of the Command class ... or override get_description.
Note: All newlines in the docstring will be collapsed and mangle the long help text.
Grouping of commands is not possible. Standard commands (for development) can't be customized under the same name or hidden. (Like for paster, the conceptual model also assumes that the sub-command naming is namespaced so commands from other packages won't conflict.)
The usage help is fully automated from the declared options.
For all deprecated Commands, replace paster hidden = True with gearbox deprecated = True
Note: config_file, takes_config_file, min_args and max_args are not available / relevant.
The gearbox parser is customized by overriding get_parser - there is nothing like paster update_parser.
Gearbox is using argparse instead of optparse ... but argparse add_argument is mostly backwards compatible with optparse add_option.
Instead of overriding command or run as in paster, override take_action in gearbox. The parsed arguments are passed to take_action, not available on the command instance.
Paster BadCommand is not available and must be handled manually, terminating with sys.exit(1).
There is no standard make-config command in gearbox.
Paster appinstall has been replaced by the somewhat different setup_app module in gearbox. There is still no clean way to pass parameters to SetupAppCommand and it relies on websetup and other apparently unnecessary complexity. Instead, implement setup-db from scratch.
Minor change by Thomas De Schampheleire: add gearbox logging configuration. Because we use logging.config.fileConfig(.inifile) during gearbox command execution, the logging settings need to be correct and contain a block for gearbox logging itself. Otherwise, errors in command processing are not even visible and the command exits silently.
|
|
|
Mads Kiilerich
|
9c6f717823e1
|
9 years ago
|
|
|
|
|
Anton Shestakov
|
cc21a2b86a30
|
9 years ago
|
|
docs: update links to Mercurial's website and wiki
Also Mercurial itself is not a coding standard, so add possessive suffix.
|
|
|
Søren Løvborg
|
2d5fecba40ed
|
9 years ago
|
|
|
|
|
Søren Løvborg
|
50f1a6adbefd
|
9 years ago
|
|
docs: separate coding/contribution guidelines
Try to separate "process" guidelines from "content" guidelines. (Just moving stuff around here, not changing the actual guidelines.)
|
|
|
Mads Kiilerich
|
dd676fdeda0f
|
9 years ago
|
|
setup: move test dependencies to dev_requirements.txt to make them optional
Remove the need for having test tools on production systems. Installing test dependencies is made an extra explicit step.
pip is the future, but doesn't have the same tests_require features as setuptools kind of has.
I don't like this way of handling it without setup.py support and with explicit naming of the ugly dev_requirements.txt ... but that seems to be the way to do it.
|
|
|
Konstantin Veretennicov
|
653fee8db519
|
9 years ago
|
|
|
|
|
Konstantin Veretennicov
|
a5a16aad6b3e
|
9 years ago
|
|
|
|
|
Mads Kiilerich
|
5262c498b3a0
|
9 years ago
|
|
docs: move translation to a separate page
Start new tradition of putting it under docs/dev/
|
|
|
Mads Kiilerich
|
e6fafb5ed70d
|
9 years ago
|
|
docs: make the default method for running tests more visible
Sometimes, users found the convoluted and risky method of testing without recreating the database before spotting the simple method.
|
|
|
Mads Kiilerich
|
f0b9706d8d7e
|
10 years ago
|
|
|
|
|
timeless@gmail.com
|
e45f5dbc2533
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
d5e16407bdbb
|
10 years ago
|
|
|
|
|
Andrew Shadura
|
250f8150c4bb
|
10 years ago
|
|
|
|
|
Thomas De Schampheleire
|
2d2decce586f
|
10 years ago
|
|
pytest migration: update documentation
Update documentation and comments to refer to pytest instead of nose.
|
|
|
Mads Kiilerich
|
8c234ae2c258
|
10 years ago
|
|
docs: add advice of upgrading pip and setuptools in new virtualenvs
Withtout this, the new virtualenv might have setuptools version 12 while the URLObject dependency mock fails because it requires setuptools>=17.1 .
|
|
|
Mads Kiilerich
|
ae9ab4c92d46
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
fbbe80e3322b
|
10 years ago
|
|
docs: consistent spacing around headings
Start out with 2 empty lines before/after for top level, decrease for deeper levels.
|
|
|
Mads Kiilerich
|
a4c0fe15a6f1
|
10 years ago
|
|
|
|
|
Søren Løvborg
|
5ae8e644aa88
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
19267f233d39
|
10 years ago
|
|
|
|
|
Søren Løvborg
|
2079e864ce51
|
10 years ago
|
|
spelling: use "email" consistently The common English spelling is "email", not "e-mail" (and was indeed also the most common, but not only, variant in the Kallithea UI). http://grammarist.com/style/e-mail-email/
|
|
|
Mads Kiilerich
|
b8d716694dc8
|
10 years ago
|
|
|
|
|
Andrew Shadura
|
f4857279cb29
|
11 years ago
|
|
|
|
|
Michael V. DePalatis
|
4e6dfdb3fa01
|
11 years ago
|
|
|
|
|
Thomas De Schampheleire
|
b08aab61c41d
|
11 years ago
|
|
docs/contributing: move 'roadmap' to the wiki
As the 'roadmap' is typically changed often, it should not be in the documentation but rather on the wiki. The wiki has been updated to reflect the latest version removed here.
|
|
|
Thomas De Schampheleire
|
f879e7ea1c4b
|
11 years ago
|
|
|
|
|
Thomas De Schampheleire
|
ef63850d1144
|
11 years ago
|
|
|
|
|
Thomas De Schampheleire
|
329dd2b2025d
|
11 years ago
|
|
|
|
|
Andrew Shadura
|
95fe05b1e5f8
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
03bbd33bc084
|
11 years ago
|
|
docs: rework stuff
The existing docs were far from how we wanted it to be. There was so much to do and it is not feasible to do that cleanup it in clean patches.
Instead, I took a sweep through the docs and changed what I thought could benefit from a change: structure, examples, advices, language, markup, content, etc.
|
|
|
Mads Kiilerich
|
a9a1560dad79
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
703d3208424c
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
e73a69cb98dc
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
7e5f8c12a3fc
|
11 years ago
|
|
First step in two-part process to rename directories to kallithea. This first step is to change all references in the files where they refer to the old directory name.
|
|
|
Bradley M. Kuhn
|
010e9532801a
|
11 years ago
|
|
|
|
|
Marcin Kuzminski
|
b53cef6faf22
|
12 years ago
|
|
|
|
|
Marcin Kuzminski
|
3563bb7b4b82
|
13 years ago
|
|
|
|
|
Marcin Kuzminski
|
8b8edfc25856
|
13 years ago
|
|
|
|
|
Marcin Kuzminski
|
63e58ef80ef1
|
13 years ago
|
|
|
|
|
Marcin Kuzminski
|
1b9d6b0a92b3
|
13 years ago
|
|
|
|
|
Marcin Kuzminski
|
4cf9af8ee623
|
13 years ago
|
|
|
|
|
Marcin Kuzminski
|
934906f028b5
|
14 years ago
|
|
|
|
|
Marcin Kuzminski
|
17c9393e9645
|
14 years ago
|
|
|
|
|
Marcin Kuzminski
|
6fdc3b25bc7c
|
14 years ago
|
|
|
|
|
Marcin Kuzminski
|
abe75448253c
|
14 years ago
|
|
|
|
|
Marcin Kuzminski
|
950110f3f99f
|
14 years ago
|
|
|
|
|
Marcin Kuzminski
|
bf263968da47
|
14 years ago
|
|
|
|
|
Marcin Kuzminski
|
f7bb54f8c20f
|
15 years ago
|
|
|
|
|
Marcin Kuzminski
|
93b980ebee55
|
15 years ago
|
|
|
|
|
Marcin Kuzminski
|
9472a0150bf0
|
15 years ago
|
|
|
|
|
Marcin Kuzminski
|
8af52e1224ff
|
15 years ago
|
|
|
|
|
jfh
|
e67786cb2afa
|
15 years ago
|
|
|
|
|
Marcin Kuzminski
|
053983a464e4
|
15 years ago
|
|
|
|
|
Marcin Kuzminski
|
bb35ad076e2f
|
15 years ago
|
|
|