-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read configuration from pyproject.toml #171
Comments
The link to https://github.com/carlosperate/awesome-pyproject is invalid, you're missing a 't' in the end. |
Any progress on providing support for pyproject.toml configuration similarly to pytest. Example here ? :) |
Hi, any updates on this ? :) Thank's ! |
It looks like this was added in 8.4.0. Woo hoo! |
Did somebody succeed to configure pylama with pyproject.toml file ? I get the following error with 8.4.1, which is 4 months old now. The issue seems to be a pure ProgrammingError (I didn't check in sources) $ pylama -o pyproject.toml . 130 ↵
Traceback (most recent call last):
File "/home/alorence/.local/bin/pylama", line 8, in <module>
sys.exit(shell())
File "/home/alorence/.local/pipx/venvs/pylama/lib/python3.10/site-packages/pylama/main.py", line 100, in shell
options = parse_options(args)
File "/home/alorence/.local/pipx/venvs/pylama/lib/python3.10/site-packages/pylama/config.py", line 203, in parse_options
cfg = get_config(options.options, rootdir=rootdir)
File "/home/alorence/.local/pipx/venvs/pylama/lib/python3.10/site-packages/pylama/config.py", line 272, in get_config
return get_config_toml(cfg_path)
File "/home/alorence/.local/pipx/venvs/pylama/lib/python3.10/site-packages/pylama/config.py", line 290, in get_config_toml
config = config_toml.Namespace()
NameError: name 'config_toml' is not defined. Did you mean: 'get_config_toml'? My pyproject.toml: [tool.pylama]
max_line_length = 120
skip = "*/.pytest_cache/*, */.tox/*, */mypy_cache/*, ./dist, ./docs"
[tool.pylama.linter.mccabe]
max-complexity = 10 |
@alorence same issue here It happens because there is some validation at config.py file that tries to import the config_toml module. For some reason, in our environments, the module could not be imported.
try:
from pylama import config_toml
CONFIG_FILES = ["pylama.ini", "pyproject.toml", "setup.cfg", "tox.ini", "pytest.ini"]
except ImportError:
CONFIG_FILES = ["pylama.ini", "setup.cfg", "tox.ini", "pytest.ini"] |
I noticed that the library "toml" is optional, and should be added by perfoming the following command:
|
Configuring your tool in
pyproject.toml
is all the new rage.Several tools have already added support, and other tools are talking about it.
Feel free to steal ideas from those projects/discussions (such as only considering it as a valid config if the
toml
package is installed, which is whatisort
does).Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: