question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configurations in `pyproject.toml` seem to be ignored

See original GitHub issue

Jupytext version: 1.13.1 Python version: 3.7.5

I have a project structure similar to the following:

project/
   |-pyproject.toml
   |-module/
      |-submodule_1/
      |-submodule_2/
         |-tests/
            |-test_notebook.ipynb

I added the following to my pyproject.toml file:

[tool.jupytext]
formats = "ipynb,py:light"

I am running jupyter from the project directory where the pyproject.toml file is also located. However, it seems that the configurations are ignored. When I save test_notebook.ipynb no .py file is generated or if there already is one, it doesn’t get updated.

If instead of modifying the pyproject.toml file, I create a jupytext.toml file at the same location and with the content

formats = "ipynb,py:light"

everything works as expected, test_notebook.ipynb is paired properly.

Am I doing something wrong when trying to configure jupytext through the pyproject.toml file? Or have I perhaps stumbled on a bug here?

And last but not least, thank you for the fantastic library.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bkarpaticommented, Jan 10, 2022

Sorry for letting this issue sit stale for such a long time. I will try to get back to it in the coming days and give your latest suggestions a go.

0reactions
richtongcommented, Jan 18, 2022

OK, I think I have a similar issue which is that the pyproject.toml is actually picked up in the --notebook-dir that is set for jupyter when you start it. So for instance for instance, my data is in ./data and the pyproject.toml needs to be there as well otherwise it doesn’t know how to sync (in my case) md and ipynb files.

This was puzzling to me for a long because sometimes I start jupyter lab at the home directory . and sometimes I set the --notebook-dir to ./data and the sync and reading of pyproject.toml happens in the former but not the later case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specify per-file-ignores with pyproject.toml and flake8
I want to add a per-file-ignores config but nothing works and there is no documentation on how it is supposed to be formatted...
Read more >
Configuration — SQLFluff 1.4.5 documentation
Configuration ¶. SQLFluff accepts configuration either through the command line or through configuration files. There is rough parity between the two ...
Read more >
Configuration options for isort
For curated common configurations, see isort's built-in profiles. ... Treat project as a git repository and ignore files listed in .gitignore.
Read more >
Help testing experimental features in setuptools - Packaging
The idea is to make the [tool.setuptools] table in pyproject.toml not ... section or adding a setup.cfg , but these seem to be...
Read more >
Flake8-pyproject - PyPI
Then run flake8 in the project root folder, where pyproject.toml is located. In case your TOML-based configuration is contained in a different folder,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found