Skip to content
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

Incremental build is not working when the plugin enabled #8

Closed
rhornig opened this issue Mar 31, 2020 · 10 comments
Closed

Incremental build is not working when the plugin enabled #8

rhornig opened this issue Mar 31, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@rhornig
Copy link

rhornig commented Mar 31, 2020

I have enabled the plugin with sphinx 2.4.4 and it seems that it interferes somehow with the incremental build process and sphinx always makes a full build when this plugin is enabled.

@jonascj
Copy link
Collaborator

jonascj commented Apr 6, 2020

@rhornig Please provide a minimal example demonstrating this (along with a requirements file for package versions).

I just tested with sphinx 2.4.4 and sphinxcontrib-images 0.9.1 and I see what I expect. If my index.html includes 1.rst and 2.rst, and I change 2.rst, then _build/html/1.html is not updated. Sphinx console output also states it only found 1 target out of date:

$ make html
Running Sphinx v2.4.4

loading pickled environment... done
Initiated sphinxcontrib-images backend: `sphinxcontrib_images_lightbox2.lightbox2:LightBox2`
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] 2                                                                                                                                                                                                                                                      
Copying static files for sphinxcontrib-images...[100%] lightbox2/img/loading.gif                                                                                                                                                                                                 
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                                                                                                                                                                                   
generating indices...  genindexdone
writing additional pages...  searchdone
copying images... [100%] figs/wiki.png                                                                                                                                                                                                                                           
copying static files... ... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

I've attached the test project, it was made with sphinx-quickstart.
issue8.zip

@kujiu
Copy link

kujiu commented May 29, 2020

Same issue here with my blog and my website (complete projects here:
https://procrastinator.nerv-project.eu/kujiu_writer/kujiulabs/ and https://procrastinator.nerv-project.eu/nerv-project/communication/nerv_website ) It's two complex projects with a lot of extensions. I'll investigate a little more during the next two weeks to say if I understand why.

@jonascj
Copy link
Collaborator

jonascj commented May 31, 2020

@kujiu Even if you don't understand why, but manage to create a small example reproducing the problem, let us know!

@kujiu
Copy link

kujiu commented Jun 4, 2020

Ok, I've found the minimal way to reproduce.

  1. create a new project from scratch with sphinx-quickstart;
  2. add 'sphinxcontrib.images' in extensions parameter;
  3. add a config_images dict in conf.py with no or several options (but not all! It works if all options are configured);
  4. launch two times make html

The index is rewritten in the second execution. No need to change index.rst.

@jonascj
Copy link
Collaborator

jonascj commented Aug 20, 2020

How time flies when you have a baby and a 3-year-old! Please accept my apologies for not attending to the PRs and issues in a timely fashion. I'll attend to them at the latest on August 29th and 30th (I have another project with deadline on August 28th).

terencehonles pushed a commit to terencehonles/sphinx-contrib-images that referenced this issue Aug 20, 2020
@jonascj jonascj added the bug Something isn't working label Sep 4, 2020
@SilverRainZ
Copy link

SilverRainZ commented Dec 27, 2020

Meet the same issue:

Running Sphinx v3.4.0
loading translations [zh_CN]... done
loading pickled environment... done
Initiated sphinxcontrib-images backend: `sphinxcontrib_images_lightbox2.lightbox2:LightBox2`
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: [config changed ('images_config')] 74 added, 5 changed, 0 removed
reading sources... [100%] todo                                                                                                                         
/home/la/.local/lib/python3.9/site-packages/sphinxcontrib/images.py:239: RemovedInSphinx40Warning: The app.add_stylesheet() is deprecated. Please use app.add_css_file() instead.
  app.add_stylesheet(os.path.relpath(dest_file_path, STATICS_DIR_PATH))
/home/la/.local/lib/python3.9/site-packages/sphinxcontrib/images.py:237: RemovedInSphinx40Warning: The app.add_javascript() is deprecated. Please use app.add_js_file() instead.
  app.add_javascript(os.path.relpath(dest_file_path, STATICS_DIR_PATH))
Copying static files for sphinxcontrib-images...[100%] lightbox2/img/loading.gif     

SilverRainZ added a commit to SilverRainZ/silverrainz.github.io that referenced this issue Feb 12, 2021
terencehonles pushed a commit to terencehonles/sphinx-contrib-images that referenced this issue Apr 18, 2021
jonascj added a commit that referenced this issue Apr 27, 2021
Fix #8: Incremental building not working (solution by terencehonles and kujiu : update the config dictionary on the config-inited event)
@terencehonles
Copy link

@SilverRainZ let's keep the discussion in the issue not the PR #18 (comment) and it might be helpful to start by saying you are still having an issue instead of suggesting the fix did not work (since it may have).

I double checked and I don't see any issues on my end and this is what I see:

Initial run (after removing the build cache):

Running Sphinx v4.0.1
Initiated sphinxcontrib-images backend: `sphinxcontrib_images_lightbox2.lightbox2:LightBox2`
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 254 source files that are out of date
updating environment: [new config] 254 added, 0 changed, 0 removed
/python3.9/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document    
  warn("Container node skipped: type={0}".format(mdnode.t))
reading sources... [100%] index                                                                                                    
Copying static files for sphinxcontrib-images...[100%] lightbox2/img/loading.gif                                                   
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                                     
generating indices... genindex py-modindex done
highlighting module code... [100%] 
writing additional pages... search done
copying images... [100%]
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 3 warnings.

and running again:

Running Sphinx v4.0.1
loading pickled environment... done
Initiated sphinxcontrib-images backend: `sphinxcontrib_images_lightbox2.lightbox2:LightBox2`
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 5 changed, 0 removed
reading sources... [100%]
Copying static files for sphinxcontrib-images...[100%] lightbox2/img/loading.gif                                                   
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                                     
generating indices... genindex py-modindex done
highlighting module code... [100%]
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 6 warnings.

I removed the build warnings since they were due to stray files in my local env.

@terencehonles
Copy link

You may want to remove the build cache manually and see if there might be something else going on. Aside from that I'm not sure how much time you want to spend debugging your issue since it doesn't seem like I can reproduce it (you may want to double check your version number and seeing if using Sphinx 4.0.1 is any different because that's what I'm using and I don't know if it broke after that)

@SilverRainZ
Copy link

@terencehonles My fault, whan I am trying to fix #23, I use the earlier version of this extension, but not 0.9.3.

@terencehonles
Copy link

Cool, good to hear you're not having issues 🙂 I was hoping it wasn't going to break in a future version of Sphinx 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants