openopt / copt

A Python library for mathematical optimization
http://openo.pt/copt
Other
135 stars 35 forks source link

Different versions of code in pypi vs GitHub #79

Closed willettk closed 3 years ago

willettk commented 3 years ago

We're using copt (on a project led by @FedericoV) for a project, and have found differences between the package imported from pypi and directly from GitHub. We're fixing the version to 0.8.3 since we use the copt.loss function, which disappears in 0.8.4. However, I get different behavior depending on how the package is installed, despite the fact that the version of the code is supposedly the same.

PyPI


$ python -m venv copt_pypi; source copt_pypi/bin/activate;

# Install directly from PyPI
$ pip install copt==0.8.3

# Check version
$ python -c "import copt; print(copt.__version__)"
0.8.3

# Throws error
$ python -c "import copt.loss"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'copt.loss'

GitHub

$ python -m venv copt_gh; source copt_gh/bin/activate;

# Install GitHub version
$ pip install git+https://github.com/openopt/copt.git

# Check version
$ python -c "import copt; print(copt.__version__)"
0.8.3

# No errors; import is successful
$ python -c "import copt.loss"

The latter works for implementation, but I want to be able to set this in a requirements.txt file or something similar and have repeatable behavior. Do you know why the two versions are different and, if so, what the best way would be of making sure we pull in the correct version consistently?

willettk commented 3 years ago

Mentioning @Louisexu825 who has experienced a similar issue.

fabianp commented 3 years ago

Thanks for the report, should be fixed in 20171150d936d1e1df4d1dd911b238e5b6751b8f

willettk commented 3 years ago

Thanks, @fabianp - confirmed that the GH version works now and is labeled as 0.9.0. I'll fix that version for our use of the package.