polm / fugashi

A Cython MeCab wrapper for fast, pythonic Japanese tokenization and morphological analysis.
MIT License
402 stars 33 forks source link

fugashi>=1.0.2 tarballs do not have their versions #29

Closed KoichiYasuoka closed 3 years ago

KoichiYasuoka commented 3 years ago

When installing from sources, fugashi==1.0.1 does indicate its version 1.0.1, but fugashi>=1.0.2 do not have their versions:

$ pip3 install fugashi==1.0.2 --no-binary fugashi
Collecting fugashi==1.0.2
  Downloading fugashi-1.0.2.tar.gz (334 kB)
     |████████████████████████████████| 334 kB 5.8 MB/s
  WARNING: Requested fugashi==1.0.2 from https://files.pythonhosted.org/packages/75/c0/5eb732b1b490a7bae2e22ab8653cc693143d411e7f2e61df613bf7e06dc2/fugashi-1.0.2.tar.gz#sha256=846148fbdd5d46a5b1b3aa31c2a0ea467d7bd62b0842f6b45f0af8dcb9ca8570, but installing version 0.0.0
Installing collected packages: fugashi
   Running setup.py install for fugashi ... done
Successfully installed fugashi-0.0.0
$ pip3 list | fgrep fugashi
fugashi                       0.0.0

It works even in Cygwin though its version-control goes broken. I suspect use_scm_version in setup.py but I'm vague...

polm commented 3 years ago

Thanks for the heads up, I'll look at why this is happening. Like you say it's probably related to setuptools_scm...

polm commented 3 years ago

In a virtualenv, I can reproduce the v0 issue, but if I install setuptools-scm first then the version number is generated correctly. So that should be a workaround for the time being.

setuptools-scm is already specified in setup-requires, so it's unclear to me why the build would work (implying Cython was used) but the version would be wrong. I'll need to look at this in more detail.

polm commented 3 years ago

This seems to be a distutils vs setuptools issue. I pushed a new alpha version, v1.1.0a1, can you confirm it works?

KoichiYasuoka commented 3 years ago

Thank you @polm, I got v1.1.0a2 work well:

$ pip3 install fugashi==1.1.0a2 --no-binary fugashi
Collecting fugashi==1.1.0a2
  Downloading fugashi-1.1.0a2.tar.gz (336 kB)
     |████████████████████████████████| 336 kB 303 kB/s
Skipping wheel build for fugashi, due to binaries being disabled for it.
Installing collected packages: fugashi
  Attempting uninstall: fugashi
    Found existing installation: fugashi 1.0.1
    Uninstalling fugashi-1.0.1:
      Successfully uninstalled fugashi-1.0.1
    Running setup.py install for fugashi ... done
Successfully installed fugashi-1.1.0a2
$ pip3 list | fgrep fugashi
fugashi                       1.1.0a2

I'm looking forward to official release of fugashi==1.1.0.