enthought / chaco

Chaco is a Python package for building interactive and custom 2-D plots.
http://docs.enthought.com/chaco/
Other
292 stars 99 forks source link

conda build failing under Windows 10, due to unresolved version. #817

Closed capn-freako closed 3 years ago

capn-freako commented 3 years ago

Problem Description

When trying to conda build chaco under Windows 10, I'm getting the following error:

RuntimeError: Unable to determine package version. No local Git clone detected, and no version file found at C:\Users\capnf\AppData\Local\Temp\pip-req-build-825e1krg\chaco\_version.py.

Reproduction Steps:

Checkout "5.0.0" and attempt a conda build, using the following recipe (i.e. - meta.yaml):

{% set name = "chaco" %}
{% set version = "5.0.0" %}

package:
  name: "{{ name|lower }}"
  version: "{{ version }}"

source:
  path: ../../chaco/

build:
  number: 1
  script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv "

requirements:
  build:
    - vs2019_win-64

  host:
    - python
    - enable
    - Cython

  run:
    - python
    - enable
# Code to reproduce issue here

Expected behavior:

I expect the conda build to succeed.

OS, Python version: [Enter OS name and Python version]

Windows 10 Python 3.7

corranwebster commented 3 years ago

Chaco and other ETS packages use the git tag to determine the version number as part of the setup.py. Assuming a git checkout, you need to have git installed in your build environment.

A better solution is that the 5.0.0 source release on PyPI should include version information and be able to be built without any need for git (if it doesn't that's a bug in the release).

I would recommend getting release sources from PyPI rather than Github for your builds, as that is the actual intended stand-alone source release.

capn-freako commented 3 years ago

Thanks, @corranwebster !

So, do you mean to suggest that if I use: git checkout 5.0.0, for instance, then my build should work (because I used a tag to perform the checkout)? I tried that and it didn't work. I do have git included in the build section of the requirements section of my meta.yaml file:

requirements:
  build:
    - setuptools
    - git
    - cmake
corranwebster commented 3 years ago

Yes, you should be able to check out a tag like that, and run the setup.py to generate the correct version information (which pip install . should do).

You are triggering this error here: https://github.com/enthought/chaco/blob/84122ae5e4f44f460904bc6f2f40585e24694a4d/setup.py#L279-L282

To avoid this, you need to have:

I don't know anything about the Conda build process, so I can't diagnose further. However the git tags aren't the "official" release of any ETS library packages. You really should be sourcing those from PyPI, and that should avoid all issues with git being present or not.

capn-freako commented 3 years ago

Okay, thanks!

One oddity: I’m able to build successfully under Windows 10, using the same code commit and meta.yaml file; any thoughts on why there’d be any difference, wrt/ this particular issue, between the two OSes?

Thanks, -db

On Oct 18, 2021, at 2:27 AM, Corran Webster @.***> wrote:

Yes, you should be able to check out a tag like that, and run the setup.py to generate the correct version information (which pip install . should do).

You are triggering this error here: https://github.com/enthought/chaco/blob/84122ae5e4f44f460904bc6f2f40585e24694a4d/setup.py#L279-L282 https://github.com/enthought/chaco/blob/84122ae5e4f44f460904bc6f2f40585e24694a4d/setup.py#L279-L282 To avoid this, you need to have:

git available to run as a subprocess in chaco and the .git directory is in its usual place; or be using a source distribution, as you would get from PyPI; or have a chaco/_version.py otherwise generated. I don't know anything about the Conda build process, so I can't diagnose further. However the git tags aren't the "official" release of any ETS library packages. You really should be sourcing those from PyPI, and that should avoid all issues with git being present or not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/enthought/chaco/issues/817#issuecomment-945580125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH7XGSNQNXVY3ON4NXNIX3UHPSATANCNFSM5DNTKYAQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

capn-freako commented 3 years ago

I was able to resolve this, by using a Git URL in the source: section of my meta.yaml file.