Giter VIP home page Giter VIP logo

zest.releaser's Issues

hardcoded version.txt leads to "IOError: [Errno 2] No such file or directory: 'setup.py'"

In a buildout-proejct (non python-package), I moved my files to
docs/changes.rst
docs.version.rst

but this breaks my release (use latest version 3.53)

INFO: Starting prerelease.
Enter version [0.5]:
Traceback (most recent call last):
File "/home/marvin/bin/fullrelease", line 46, in
sys.exit(zest.releaser.fullrelease.main())
File "/apps/buildouts/tools/buildout/eggs/zest.releaser-3.53-py2.7.egg/zest/releaser/fullrelease.py", line 21, in main
prerelease.main()
File "/apps/buildouts/tools/buildout/eggs/zest.releaser-3.53-py2.7.egg/zest/releaser/prerelease.py", line 168, in main
prereleaser.run()
File "/apps/buildouts/tools/buildout/eggs/zest.releaser-3.53-py2.7.egg/zest/releaser/baserelease.py", line 26, in run
self.execute()
File "/apps/buildouts/tools/buildout/eggs/zest.releaser-3.53-py2.7.egg/zest/releaser/prerelease.py", line 63, in execute
self._write_version()
File "/apps/buildouts/tools/buildout/eggs/zest.releaser-3.53-py2.7.egg/zest/releaser/prerelease.py", line 84, in _write_version
self.vcs.version = self.data['new_version']
File "/apps/buildouts/tools/buildout/eggs/zest.releaser-3.53-py2.7.egg/zest/releaser/vcs.py", line 210, in _update_version
setup_lines = open('setup.py').read().split('\n')
IOError: [Errno 2] No such file or directory: 'setup.py'

problem is https://github.com/zestsoftware/zest.releaser/blob/master/zest/releaser/vcs.py#L194

add support for version.rst, similar to changes.rst

Using latest zest.releaser 3.52

In some projects we want to move CHANGES.txt and VERSION.txt to
docs/CHANGES.rst , docs/VERSION.rst as part of a sphinx-documentation,

while changes.rst is currently allowed, version.rst is not.

want_release always True due to pypi config "Safety valve"

The PypiConfig.want_release method is designed to read a .pypirc or setup.cfg file and return False if it contains:

[zest.releaser]
release = no

which is the sole content of my setup.cfg file.

However PypiConfig._read_configfile does a check of validity:

    if (not self.is_old_pypi_config() and
            not self.is_new_pypi_config()):
        # Safety valve
        self.config = None

the is_old_pypi_config and is_new_pypi_config methods check for server-login:username and distutils:index-servers respectively in your config file. If you have neither of these section:keys you activate the "Safety valve" and get no pypi config.

This means I cannot prevent release (unless I add dummy sections, about servers... that I don't want to release to).

Not quite sure what the solution is. One backwards incompatible idea would be to move the want_release method to SetupConfig, and no longer support release = no in your .pypirc file?

So am I doing something wrong, or happy to write a patch, if there's a solution agreed.

Feature request: Check if version is already available

It would be nice if zest.releaser could do some more checks before releasing a package:

  • Check if package/version already exists on repository (pypi, plone.org, etc.)
  • Check if tag already exists in code repo (git/svn)

I now it's easy to check this by your self, but it would be a nice feature for the lazy people out there ;-)

regards mat

UserWarning:Unknowndistributionoption:'message_extractors'

Sample setup.py

import os
...

setup(name='foo',
...
      message_extractors={'.': [
          ('**.py', 'lingua_python', None),
          ('**.pt', 'lingua_xml', None),
          ('**.jst', 'lingua_python', None),
      ]},
...
      )

The resulting error:

You may want to quit and fix this.
Do you want to continue with the release?
Enter version [1.0.0
/usr/lib/python2.7/distutils/dist.py:267:UserWarning:Unknowndistributionoption:'message_extractors'
warnings.warn]: 

Have the possibility to specify the history file location

It would be useful to have the possibility to specify where the history file is.

I've already written some code on my machine for that but I'm waiting for the issue #17 with the code that make SetupConfig available for all the release steps.

This issue offers one another solution to solve the issue #22

should depend on docutils?

I used it a lot in the past but I recently formatted my PC and started on ubuntu 14.04 from scratch. I just installed it and ran into this:

# longtest 
sh: 1: rst2html.py: not found
sh: 1: rst2html: not found
sh: 1: rst2: not found
ERROR: Error generating html. Please install docutils (or zc.rst2).

Shouldn't docutils be installed as dependency?

Feature Request: Create a warning if setuptools-X is not in path and VCS is X

It would be nice if zest releaser would issue a warning if one is preparing a release with source code managed via X(e.g. git) and setuptools-x (eg. setuptools-git) is not installed.

This helps avoiding building eggs that miss most of the source code, because the setuptools magic does not know how to handle checked in files information for X(e.g. git)

Use mock instead of our custom test hacks

We have quite some hacks to intercept sys.exit, to set environment variables, to work around input-grabbing functions and so.

I think mock could make our lives easier. On the other hand, the current setup works fine...

But perhaps we don't have to do so many full-scale doctests if we can more easily mock selected methods within our own classes and then use mock to only check if they've been called?

Check fad sdist .tar.gz files

There could be some kind of logic to check if sdist did not produce a egg which look legit.

One common reason is that MANIFEST.in has some errors and it simply does not include the main directory of your package.

Could it be simple to add logic that sdist contains at least one file which is not init.py?

Shouldn't the egg land in the dist directory if not uploading to PyPI?

Because the egg didn't go to dist folder (plone/src/product.name/dist) I spent a while looking around for why my egg wasn't built, until I realised that I didn't have my plugins installed.

The egg was built of course - it had just landed in somewhere like:

 /tmp/product.name-0.2.3-Prt03G/gitclone/dist

Support twine for uploading

Since setup.py upload does not support HTTPS, but twine does, it would be nice if zest.releaser supported that (at least additionally, but probably even instead of the old method).

svn fails to handle project within project

Some legacy projects, often converted from CVS, have multiple subprojects
under a single trunk. This creates URLs that contain a regular svn layout
within an top level trunk. For example:

trunk/
    projectA/
        trunk/
        tags/
        branches/

    projectB
        trunk/
        tags/
        branches/

Currently, when trying to release projectB, zest.releaser tries to create trunk/tags rather than trunk/projectB/tags.

Usage instructions missing

zest.releases goes great length in detail telling what the package can or cannot do. However, it actually fails to tell you how do you actually run the software to do a release. README is very confusing from the point of a new user and thus might hinder the adoption of a good tool.

The README should at least highlight the process for

  1. Tag a release

  2. Make a source distribution

  3. Upload it to pypi

What could help is to have "Examples" section like with jarn.mkrelease in README:

http://pypi.python.org/pypi/jarn.mkrelease

release now fails because of PEP440

Trying to release a piece of software, I get the following error:

stefanesmacbook% release
Tag needed to proceed, you can use the following command:
git tag 0.2.1.dev0.dev190.g98425aa
/usr/local/lib/python2.7/site-packages/setuptools/dist.py:298:UserWarning:Theversionspecified('0.2.1.dev0.dev190.g98425aa')isaninvalidversion,thismaynotworkasexpectedwithnewerversionsofsetuptools,pip,andPyPI.PleaseseePEP440formoredetails.
"details."%self.metadata.version -m "Tagging 0.2.1.dev0.dev190.g98425aa
/usr/local/lib/python2.7/site-packages/setuptools/dist.py:298:UserWarning:Theversionspecified('0.2.1.dev0.dev190.g98425aa')isaninvalidversion,thismaynotworkasexpectedwithnewerversionsofsetuptools,pip,andPyPI.PleaseseePEP440formoredetails.
"details."%self.metadata.version"
Run this command (Y/n)?
/bin/sh: -c: line 1: syntax error near unexpected token `'0.2.1.dev0.dev190.g98425aa''
/bin/sh: -c: line 1: `/usr/local/lib/python2.7/site-packages/setuptools/dist.py:298:UserWarning:Theversionspecified('0.2.1.dev0.dev190.g98425aa')isaninvalidversion,thismaynotworkasexpectedwithnewerversionsofsetuptools,pip,andPyPI.PleaseseePEP440formoredetails.'


Failed to create tag 0.2.1.dev0.dev190.g98425aa
/usr/local/lib/python2.7/site-packages/setuptools/dist.py:298:UserWarning:Theversionspecified('0.2.1.dev0.dev190.g98425aa')isaninvalidversion,thismaynotworkasexpectedwithnewerversionsofsetuptools,pip,andPyPI.PleaseseePEP440formoredetails.
"details."%self.metadata.version!

(prerelease also prints similar messages, but only as a warning.)

I suspect this is related to the fact that I have installed recently setuptools 8.2.1.

If I revert setuptools to, say, version 3.6, it works as before.

Add support for Subversion1.7

Hello,

Using the latest zest.releaser 3.39, I got surprised by following message when running "fullrelease" in my svn-trunk-folder:

CRITICAL: No version control system detected.

However nothing is wrong with my svn-checkout. I'm using a recent svn:

svn --version
svn, version 1.7.6 (r1370777)

The problem is that zest.releaser searches for a ".svn"-directory in the current location (choose.py)
That assumption no longer holds in subversion1.7.
From the SVN-book, http://svnbook.red-bean.com/en/1.7/svn-book.pdf (page 10):

Prior to version 1.7, Subversion maintained .svn administrative subdirectories in every versioned directory of your working copy. Subversion 1.7 offers a completely new approach to how working copy metadata is stored and maintained, and chief among the visible changes to this approach is that each working copy now has only one .svn subdirectory which is an immediate child of the root of that working copy."

Maybe it's easier to checkout the output of "svn info" executed in the current directory.

Find HISTORY.rst

Like with README. HISTORY / CHANGELOG may nowadays have .rst extension for Github convenience purposes.

Where one should poke to add in detection for this?

Have a way to update the version in multiple files

I have a scenario where I'd like:

  • to have a single canonical source for the version (release.ini, version.txt or whatever)

  • get zest.releaser manage the cannonical location (above mentioned) but also:

    • update setup.py with version changes (simple string replace, or some "version = '(.*)'" regex)
    • update mypackage/init.py with version changes (simple string replace, or some "__version__ = '(.*)'" regex)

    Now this would be configurable (you'd give zest.releaser the list of files).

Essentially that is similar to what https://pypi.python.org/pypi/bumpversion does.

The advantage is that you don't need to have fragile version loading code anymore in your init.py or setup.py.

What do you think?

Add recommended extra requirements in setup.py

We could add a list of recommended extras in setup.py, to be installed with zest.releaser[recommended]. This would indicate that we recommend these extra packages if you want to properly release to PyPI. We will want to keep an eye on these, possibly run their tests to see if they break when we change something, and add minimum version requirements if a new version is really needed. I would add these:

    zest.pocompile
    check-manifest
    pyroma

Possibly gocept.zestreleaser.customupload, because I happily use it, but that has nothing to do with releasing to PyPI.

@reinout, what do you think of this?

Cc @iElectric as he wants something like this.

Wishlist: do git fetch and abort if the current branch is out of date

I just released z3c.coverage 2.0.1 with one missing fix because I forgot to git pull before running fullrelease.

It would be nice if zest.releaser did a git fetch and compared HEAD with the origin (e.g. git log --oneline ..origin), and then asked me if I wanted to continue and miss those changes (defaulting to N).

Error when setup.cfg doesn't specify tag_svn_revision

I got this when trying to release Products.TinyMCE.

Traceback (most recent call last):
File "/opt/local/bin/release", line 9, in
load_entry_point('zest.releaser==3.30', 'console_scripts', 'release')()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/zest.releaser-3.30-py2.6.egg/zest/releaser/release.py", line 268, in main
releaser.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/zest.releaser-3.30-py2.6.egg/zest/releaser/baserelease.py", line 22, in run
self.execute()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/zest.releaser-3.30-py2.6.egg/zest/releaser/release.py", line 57, in execute
self._release()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/zest.releaser-3.30-py2.6.egg/zest/releaser/release.py", line 209, in _release
if setup_config.has_bad_commands():
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/zest.releaser-3.30-py2.6.egg/zest/releaser/pypi.py", line 81, in has_bad_commands
if self.config.getboolean('egg_info', 'tag_svn_revision'):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ConfigParser.py", line 349, in getboolean
v = self.get(section, option)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ConfigParser.py", line 541, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'tag_svn_revision' in section: 'egg_info'

zest.releaser updates wrong CHANGES.txt

While executing bin/fullrelease (buildout installation of zest.releaser). I got the following output:

$ bin/fullrelease 
INFO: Starting prerelease.
Enter version [1.1]: 
INFO: Set setup.py's version to '1.1'
INFO: Changed version from '1.1dev' to '1.1'
INFO: History file ./eggs/Zope2-2.12.23-py2.7-linux-x86_64.egg/ZTUtils/CHANGES.txt updated.
INFO: The 'svn diff':



OK to commit this (Y/n)? n

So, clearly, zest.releaser located the wrong file, which in my case should have been:

docs/HISTORY.txt

One quick and generic fix is to check, in BaseVersionControl.filefind() if the file found is actually under version control. With SVN this is simple by checking the exit status of the svn info <filename> command for a file, which is non-zero (error) for a file not under version control.

With git this would be slightly more complicated, requiring parsing the output of git status <filename> or checking if git log -1 <filename> produces any output at all.

Failure when svn-releasing on Windows: \r\n versus \n

I've installed zest.releaser 3.37 in a virtualenv in Windows7 (don't ask :).
The repository is an SVN.

When doing a fullrelease, it fails with a message "Failed to create 0.2!"
After inspection the following lines are not crossplatform

https://github.com/zestsoftware/zest.releaser/blob/master/zest/releaser/svn.py#L102

    def available_tags(self):
        ....
        tags = [line.replace('/', '') for line in tag_info.split('\n')]      # DOES NOT TAKE INTO ACCOUNT \r\n
        tags = [tag for tag in tags if tag]  # filter empty ones

My variable taginfo here is "0.1/\r\n0.2/\r\n", so I end up with a variable tags = [ "0.1\r", "0.2\r"]

A simple fix is to add an extra strip:

    def available_tags(self):
        ....
        tags = [line.replace('/', '') for line in tag_info.split('\n')]
        tags = [tag.strip() for tag in tags if tag]     # strip windows line-separators + filter empty ones

the nicest solution is to use the splitlines-method on a string:

    >>> tag_info =  "0.1/\r\n0.2/\r\n"
    >>> tags = [tag.strip('/') for tag in tag_info.splitlines()]
    >>> tag
             [ "0.1", "0.2"]

but I haven't checked if that works for all supported python-versions.
Cfr. http://docs.python.org/glossary.html#term-universal-newlines

README.rst not picked up

Due to Github, people have started to use README.rst instead of README.txt.

However, zest.releaser does not check for its existenece:

     warning: sdist: standard file not found: should have one of README, README.txt 

Using zest.release in combination with git-flow

I want to use zest.releaser together wit git-flow. However, git-flow is writing tags and zest.releaser is also writing tags. So we get sets of unrelated tags. Would there be a way to avoid this situation. Maybe a flag to skip the writing of tags?

setup.py not always able to update version, so error?

During prerelease, there's a possibility that zest cannot find a way to update your package version number. For example setting your version number in setup.py from a variable set in mypackage.__init__.py and forgetting to set python_file_with_version in a setup.cfg.

In this case, your package version number is readable, but not writeable.

This bug hit us today, and raised the question: why would zest continue if it couldn't update your version number?

When it does continue it get's really confused:

  1. prerelease updates just the history file, no other file
  2. postrelease updates just the history file, to a wrong value! Because it assumes prerelease incremented the package version somewhere.

Here's vcs.py:BaseVersionControl._update_version where zest looks for the right place to update a version string.

I propose that zest raise an exception at the end of that method, if it cannot find a place to update your package version number. Or maybe I'm missing something, is there a deliberate reason zest continues in this case?

I'm happy to write a patch if there's agreement on this.

WindowsError while getting version from setup.py - caused by wrong environment

Using python2.7 64-bit on Windows 7, with a virtualenv active.

While running prerelease, an odd error is raised while probing for the version number with setup.py --version (getting the whole traceback required a minor change to get_setup_py_version):

CRITICAL: The setup.py of this package has an error:
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    setup(
  File "c:\Users\Rio\Documents\mcedit2-distrib\mcedit2\src\mceditlib\setup.py", line 1, in <module>
    from setuptools import setup
  File "c:\Users\Rio\Documents\mcedit2-distrib\mcedit2\ENV64\lib\site-packages\setuptools\__init__.py", line 12, in <mod
ule>
    from setuptools.extension import Extension
  File "c:\Users\Rio\Documents\mcedit2-distrib\mcedit2\ENV64\lib\site-packages\setuptools\extension.py", line 8, in <mod
ule>
    from .dist import _get_unpatched
  File "c:\Users\Rio\Documents\mcedit2-distrib\mcedit2\ENV64\lib\site-packages\setuptools\dist.py", line 23, in <module>

    from setuptools.depends import Require
  File "c:\Users\Rio\Documents\mcedit2-distrib\mcedit2\ENV64\lib\site-packages\setuptools\depends.py", line 6, in <modul
e>
    from setuptools import compat
  File "c:\Users\Rio\Documents\mcedit2-distrib\mcedit2\ENV64\lib\site-packages\setuptools\compat.py", line 17, in <modul
e>
    import httplib
  File "C:\Python27-64\Lib\httplib.py", line 79, in <module>
    import mimetools
  File "C:\Python27-64\Lib\mimetools.py", line 6, in <module>
    import tempfile
  File "C:\Python27-64\Lib\tempfile.py", line 35, in <module>
    from random import Random as _Random
  File "C:\Python27-64\Lib\random.py", line 879, in <module>
    _inst = Random()
  File "C:\Python27-64\Lib\random.py", line 97, in __init__
    self.seed(x)
  File "C:\Python27-64\Lib\random.py", line 111, in seed
    a = long(_hexlify(_urandom(16)), 16)
WindowsError: [Error -2146893818] Invalid Signature

CRITICAL: No version found.

This error is not raised when running setup.py by itself.

After some investigating, I learned this error is the Windows DLL loader (Windows Side-By-Side) unable to locate the crypto libraries - because the SYSTEMROOT environment variable is not present! The root cause is in your utils.system function, which substitutes a nearly-empty env dict whenever the exe passed to utils.system is the Python exe used to run prerelease.

Unless I'm missing something, the fix is to copy os.environ and update its PYTHONPATH instead of create a new dict for env.

Abort on PyPi HTTP issues

If PyPi upload fails abort fullrelease

(otherwise reupload attemps become painful when you have done postrelease step)

Register and upload to pypi (y/N)? yes
INFO: Running: /Users/mikko/code/plone-venv/bin/python setup.py register -r pypi sdist --formats=zip upload -r pypi
Showing first few lines...
running register
running egg_info
writing paster_plugins to mfabrik.webandmobile.egg-info/paster_plugins.txt
writing requirements to mfabrik.webandmobile.egg-info/requires.txt
writing mfabrik.webandmobile.egg-info/PKG-INFO
...
Showing last few lines...
unrecognized .svn/entries format in
Upload failed (503): Server Maintenance

... oops

Wishlist: update __version__ in a specified .py file

For various reasons I often have a statement like this

__version__ = '2.4.frog-knows'

in one of my *.py files, and a setup.py that extracts it from there. If I try to run fullrelease in such a package, it fails to update the version number and tries to create incorrect tags etc.

I'd like to be able to tell zest.releaser where the version is defined, perhaps in setup.cfg? Something like

[zest.releaser]
version-file = src/gtimelog/__init__.py

blacklist debian/changelog

My changelog is in docs/changelog.rst but I have debian packaging code (debian/changelog) so zest releaser picks debian/changelog (because filename is shorter) while it definitely does not know how to handle the file.

"No module named setuptools" when setuptools not installed in python

I'm using a dedicated python 2.7.5 and buildout to install Plone, but because setuptools is not installed in that python, I get the following error for longtest & prerelease:

/dev/Plone/Development/project/src/visualtitle$ ../../bin/longtest
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup
ImportError: No module named setuptools
ERROR: Error generating long description.

Feature-request: release directly from an url

Zest.releaser works on a local directory that is checked out from svn/git/hg.

When trying to make people warm to adopt zest.releaser, I received feedback that it would be nice to be able to make releases just by pointing to a trunk-url. This feedback comes from a team that is doing some script-development on Windows behind corporate proxy.

The workflow would be then: they keep working like they do now; but when code is ready, they can SSH to some linux-box where there is a virtualenv installed and an appropriate .pypirc, and they just do:

fullrelease svn+ssh://user@host/packages/<my_package>/trunk

( the checkout is made in a tmp-folder.)

zest.releaser doesn't honor SVN files

zest.releases doesn't honour SVN added repository files when creating a package. I think this is the default setuptools behavior. Only .py files are packed. This caused malformed packages which have files left out.

Getting distribution for 'mfabrik.webandmobile'.
error: docs/HISTORY.txt: No such file or directory
An error occured when trying to install mfabrik.webandmobile 1.0.11. Look above this message for any errors that were output by easy_install.
While:
  Installing instance. 

Subversion 1.7.

how to generate an sdist generated without uploading it?

My use-case: make a release, create an sdist-egg and scp this tarball to some location that serves as index-server.

For this I'm trying to use zest.releaser + gocept.zestreleaser.customupload (v1.4)

I configure my .pypirc as specified in the docs of gocept.zestreleaser.customupload,
but there is no sdist created that can be scp'ed.

It seems the generation of an sdist depends on the presence of a[distutils]-section in .pypirc, but you can't leave this empty without breaking things

So the question boils down to: how to create a tarball of the package without uploading with via zest.releaser and defer it to gocept.zestreleaser.customupload

Maybe I'm missing something obvious.

Handling wheels

It seems that the wheel format is not handled by zest.releaser. It would be nice that if [bdist_wheel] is present in setup.cfg then

python setup.py sdist bdist_wheel upload

is called instead of:

python setup.py sdist upload

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.