zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

Problems with package name #355

Open hgrecco opened 4 years ago

hgrecco commented 4 years ago

I am having a problem releasing a (new) package.

The package name is pint-pandas

pyroma says:

INFO: Found pint-pandas

Then, the process continues and it says:

Tag checkout placed in /private/var/folders/xj/xsrq0ml15_q98sq78466mbwr000bjr/T/pint-pandas-0.1-c223ko64/gitclone
[...]
creating pint_pandas.egg-info
[...]
Writing pint-pandas-pandas-0.1/setup.cfg

Notice that I get two distinct names:

I am using setuptools_scm, but I think that is not the problem as I get:

$ python setup.py --name
pint-pandas
$ python setup.py --version
0.1.dev45+g47ce52e
$ python setup.py --fullname
pint-pandas-0.1.dev45+g47ce52e

any ideas?

mauritsvanrees commented 4 years ago

First guess is that this is not related to zest.releaser. I think this happens when we call this command:

python setup.py egg_info

Do you get the same problem when you call this manually?

Otherwise, is this in a public repository that we can inspect? Or can you share the setup.py and setup.cfg? Which Python version is this?

hgrecco commented 4 years ago

I am using Python 3.8.3 for releasing using the following command:

$ SETUPTOOLS_SCM_PRETEND_VERSION=0.1 fullrelease

You can find the repo here: https://github.com/hgrecco/pint-pandas

$ python setup.py egg_info
running egg_info
creating pint_pandas.egg-info
writing pint_pandas.egg-info/PKG-INFO
writing dependency_links to pint_pandas.egg-info/dependency_links.txt
writing requirements to pint_pandas.egg-info/requires.txt
writing top-level names to pint_pandas.egg-info/top_level.txt
writing manifest file 'pint_pandas.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'version.txt'
warning: no files found matching 'readthedocs.yml'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes/.git'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching 'bors.toml'
warning: no previously-included files found matching 'pull_request_template.md'
warning: no previously-included files found matching 'requirements_docs.txt'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*__pycache__*' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '.travis-exclude.yml' found anywhere in distribution
writing manifest file 'pint_pandas.egg-info/SOURCES.txt'
hgrecco commented 4 years ago

Some more information. The first time the version is right, then is wrong. I checked the PKG-INFO file within the egg-info folder. The version is correct (0.1) until INFO: Starting release. where it changes to Pandas-0.1

I tried halting the execution of zest and running python setup.py egg_info at each step and I was never able to get such version.

SETUPTOOLS_SCM_PRETEND_VERSION=0.1 fullrelease -v
INFO: Starting prerelease.
DEBUG: Running command: '/Users/grecco/anaconda3/envs/ppi-devel/bin/python setup.py egg_info'
DEBUG: Stderr of running command '/Users/grecco/anaconda3/envs/ppi-devel/bin/python setup.py egg_info':
warning: no files found matching 'version.txt'
warning: no files found matching 'readthedocs.yml'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes/.git'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching 'bors.toml'
warning: no previously-included files found matching 'pull_request_template.md'
warning: no previously-included files found matching 'requirements_docs.txt'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*__pycache__*' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '.travis-exclude.yml' found anywhere in distribution

DEBUG: Running command: '/Users/grecco/anaconda3/envs/ppi-devel/bin/python setup.py --name'
Run pyroma on the package before tagging? (Y/n)?
INFO: ------------------------------
INFO: Checking /Users/grecco/Documents/code/pint-pandas
INFO: Found Pint-Pandas
INFO: ------------------------------
INFO: Final rating: 10/10
INFO: Your cheese is so fresh most people think it's a cream: Mascarpone
INFO: ------------------------------
Do you want to run check-manifest? (Y/n)?
lists of files in version control and sdist match
DEBUG: Running command: 'git symbolic-ref --quiet HEAD'
DEBUG: Running command: 'git status --short --untracked-files=no'
DEBUG: Decoding file version.py from encoding ascii.
DEBUG: Matching __version__ line found: '__version__ = '0.1''
DEBUG: Extracted version: 0.1
DEBUG: Running command: 'git ls-files'
DEBUG: Found CHANGES
DEBUG: Checking CHANGES
DEBUG: Decoding file CHANGES from encoding ascii.
DEBUG: Found heading: '{'line': 3, 'version': '0.1', 'date': 'unreleased'}'
Changelog entries for version 0.1:

0.1 (unreleased)
----------------

- first public release.

DEBUG: Decoding file version.py from encoding ascii.
DEBUG: Matching __version__ line found: '__version__ = '0.1''
DEBUG: Extracted version: 0.1
Enter version [0.1]:
DEBUG: Set heading from '0.1 (unreleased)' to '0.1 (2020-07-01)'.
DEBUG: Set line below heading to '----------------'
INFO: History file CHANGES updated.
DEBUG: Running command: 'git diff'
INFO: The 'git diff':

diff --git a/CHANGES b/CHANGES
index e7802cb..d795d2e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,7 @@
 pint-pandas Changelog
 =====================

-0.1 (unreleased)
+0.1 (2020-07-01)
 ----------------

 - first public release.

OK to commit this (Y/n)?
DEBUG: Running command: 'git commit -a -m 'Preparing release 0.1''
INFO: [master 9ccc4ca] Preparing release 0.1
 1 file changed, 1 insertion(+), 1 deletion(-)

INFO: Starting release.
DEBUG: Running command: '/Users/grecco/anaconda3/envs/ppi-devel/bin/python setup.py egg_info'
DEBUG: Stderr of running command '/Users/grecco/anaconda3/envs/ppi-devel/bin/python setup.py egg_info':
/Users/grecco/anaconda3/envs/ppi-devel/lib/python3.8/site-packages/setuptools/dist.py:468: UserWarning: The version specified ('Pandas-0.1') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  warnings.warn(
warning: no files found matching 'version.txt'
warning: no files found matching 'readthedocs.yml'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes/.git'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching 'bors.toml'
warning: no previously-included files found matching 'pull_request_template.md'
warning: no previously-included files found matching 'requirements_docs.txt'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*__pycache__*' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '.travis-exclude.yml' found anywhere in distribution

DEBUG: Running command: '/Users/grecco/anaconda3/envs/ppi-devel/bin/python setup.py --name'
DEBUG: Stderr of running command '/Users/grecco/anaconda3/envs/ppi-devel/bin/python setup.py --name':
/Users/grecco/anaconda3/envs/ppi-devel/lib/python3.8/site-packages/setuptools/dist.py:468: UserWarning: The version specified ('Pandas-0.1') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  warnings.warn(
mauritsvanrees commented 4 years ago

For me it seems fine. I tried this (using the split prerelease and release, ignoring postrelease here, but should be same as fullrelease):

git clone git@github.com:hgrecco/pint-pandas.git
cd pint-pandas/
python3.8 -mvenv .
. bin/activate
bin/pip install -e .
bin/pip install -U pip
bin/pip install zest.releaser
export SETUPTOOLS_SCM_PRETEND_VERSION=0.1
prerelease
python setup.py --version
release 
cd /...temporary/folder/Pint-Pandas-0.1-0yeps8b9/gitclone
python setup.py --version
unset SETUPTOOLS_SCM_PRETEND_VERSION
python setup.py --version
less Pint_Pandas.egg-info/PKG-INFO 

Always, the version is 0.1, as expected.

One idea: maybe you have zest.releaser installed in a different virtualenv than where you have setuptools_scm installed? Then when zest.releaser calls python setup.py --version or egg_info, it uses its own Python and does not have the setuptools_scm package, which may give a different result. But: still strange that is initially works, in the prerelease phase. So suggestion: make sure both zest.releaser and setuptools_scm are installed in the same environment. Maybe that helps.

Note: I don't use setuptools_scm myself.

reinout commented 1 year ago

We're using "build" instead of "python setup.py" now (at least, the 9.0.0 alpha is out). I hope that fixes the issue?