Comments (4)
I can see two simple solutions.
The simplest, which solves only the problem of git complaining, is to put specfile.c
in .gitignore
. Whenever a change is made to the .pyx
file, one has to remember to do a git add --force silx/io/specfile/specfile.c
after the file has been regenerated. This solution has the advantage of not adding any line of code to the setup.py
and not changing the current behavior of setup.py
.
The second solution is to also add the auto-generated file to .gitignore
, then to make a copy of it to a file (for instance specfile.c.in
) that will not be ignored, and to add code to the setup.py
to copy specfile.c.in
to specfile.c
before compiling unless the command line --force-cython
is specified when running setup.py
. This adds a manual copy step and makes setup.py
more complex. The check_cython()
would have to be changed in the general setup.py
: --no-cython
, fake_cythonize()
and os.environ["WITH_CYTHON"] = "False"
should become the default behavior.
This second option only makes sense if we don't trust Cython on the user computer to generate proper .c
files.
from silx.
The first solution still overwrites the supplied reference file.
The second solution serves to check if something was wrong at the
building end with, for instance, a buggy cython or for speeding up things.
I am full for copying/renaming a supplied file and not just adding it to
the list of ignored files.
from silx.
I worked on the issue, and found that if we want to go down that road, the required steps would be:
- supply a default file, either in a different folder than the
pyx
file, or with a different name than the cython-generated file (e.gsilx/io/specfile.c.in
) - add this file to
MANIFEST.in
- in the local
silx/io/setup.py
, ifos.environ["WITH_CYTHON"]=="False"
, copy and rename the supplied file to wherever the compiler expects it to be (e.gsilx/io/specfile.c
) - in the general
setup.py
, movecheck_cython()
beforeconfiguration()
, so that the environment variableWITH_CYTHON
is set before importing the localsetup.py
- optionally: remove the cython-generated C file from the repository (delete and add a line to
.gitignore
)
This solution seems to work on all tested platforms on my development branch https://github.com/PiRK/silx/tree/nocython
from silx.
Ok, from the enhancement the only thing that is going to remain seems to be this:
- in the general setup.py, move check_cython() before configuration(), so that the environment variable WITH_CYTHON is set before importing the local setup.py
that I think it was already fixed by #73
from silx.
Related Issues (20)
- overriding the match ratio in opencl/sift/match.py HOT 1
- h5py_utils fork deprecation warning
- Building `silx` against development version of numpy HOT 2
- `noexcept clause is ignored` warning in Cython code HOT 3
- Add `Tiled` data sources to browse Bluesky runs HOT 8
- Warning in Cython compilation HOT 3
- [2.1.0] Debian build and how to skip ascent downloading ? HOT 4
- How can I copy the data in Raw view? HOT 2
- silx view - HDF5view - improve scroll area HOT 1
- silx.gui.dialog GroupDialog and DatasetDialog are missing an API to select an hdf5 entity
- Add a 'auto' imagej like option HOT 2
- silx view: Large 2D datasets are open HOT 2
- Documentation: Describe conda packaging
- [ExternalResources] Allow to set `_data_home`
- tests failures against Pytest 8.2.0 HOT 4
- Issue with DataViewer when removing views HOT 1
- addCurve advances color index even if color is provided HOT 3
- CI random failure in TestImageFileDialogInteraction.testClickOnBackToParentTool test
- Lineplot window doesn't open on Wayland HOT 1
- [2.1.0] pointer ‘peaks0’ may be used after ‘realloc’ [-Wuse-after-free] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silx.