jelmer / xandikos

A CalDAV/CardDAV server backed by Git
https://www.xandikos.org/
GNU General Public License v3.0
423 stars 42 forks source link

No executable script on Windows #163

Closed alensiljak closed 2 years ago

alensiljak commented 2 years ago

Related to the discussion here, I've figured out what the problem is. On Windows, scripts xandikos and xandikos.py are created in the Python Scripts folder. However, not having an extension, the xandikos script is not considered to be an executable file. If I remember well, Python normally creates .bat files as executables in the script directory, if an entry point is defined for a console script in setup.py.

alensiljak commented 2 years ago

Also, when running the xandikos.py script:

image

jelmer commented 2 years ago

That's really something dependent on the way you install Xandikos rather than Xandikos itself; I don't know how well pip does in this regard on windows.

Happy to take reasonable patches to improve things.

alensiljak commented 2 years ago

Hmm... Well, look at this: if I install Xandikos via pip and run

pip install xandikos
xandikos

I get 'xandikos' is not recognized as an internal or external command, operable program or batch file.

On the other hand, if I install cashiersync and run:

pip install cashiersync
cashiersync

it runs fine on Windows, Linux, Termux...

The missing piece of magic could be:

    entry_points={
        'console_scripts': [
            'cashiersync = cashiersync.main:run_server',
        ],
    },

if I remember well. I see that you have the scripts entry in setup.py but no entry_points. Could that be the reason?

I will try to play around with this.