Skip to content

Conversation

RonnyPfannschmidt
Copy link
Contributor

@jaraco @anthrotype i'd appreciate a harsh review of this experiment

@RonnyPfannschmidt RonnyPfannschmidt merged commit 9cf2009 into pypa:master Oct 20, 2016
@RonnyPfannschmidt RonnyPfannschmidt deleted the git-shallow branch October 20, 2016 21:46
@anthrotype
Copy link

hey! this looks good.
However, I'm not sure how I should tell setuptools_scm to use a custom parse function so that it calls
fetch_on_shallow as pre_parse action.

anthrotype pushed a commit to anthrotype/booleanOperations that referenced this pull request Oct 21, 2016
Trying out an experimental feature that was added in setuptools_scm 1.15.0:
pypa/setuptools-scm#118
@RonnyPfannschmidt
Copy link
Contributor Author

RonnyPfannschmidt commented Oct 21, 2016

@anthrotype

def myparse(root}:
  from setuptools_scm.git import parse, fetch_on_shallow
  return parse(roor, pre_parse=fetch_on_shallow)

pass that as parse function in the dict

@anthrotype
Copy link

thanks! that's what I did here more or less.

@RonnyPfannschmidt
Copy link
Contributor Author

@anthrotype since this is the first iteration of the api, im curious about extending it a bit, perhaps bringing in a entrypoint and maybe formalizing on workdir classes for utilities/detailed parsing

would you be willing/open to do a open discussion on such details in order to drive the implementation ideas forward?

anthrotype pushed a commit to anthrotype/booleanOperations that referenced this pull request Oct 21, 2016
Trying out an experimental feature that was added in setuptools_scm 1.15.0:
pypa/setuptools-scm#118
@anthrotype
Copy link

sure, I'll do my best to help, if I can.

@RonnyPfannschmidt
Copy link
Contributor Author

open for doing a google hangout and talking about the issues a bit?

@anthrotype
Copy link

I just tried using the custom pre_parse approach, but I think there's still some issues:

The sdist zip file has the correct version string, but when tox installs it, it bears a 0.1.dev0 version:

https://travis-ci.org/anthrotype/booleanOperations/jobs/169540938#L165

I've tried locally as well, with the following steps:

$ git clone --depth=50 --branch=git-fetch-on-shallow https://github.com/anthrotype/booleanOperations.git booleanOperations-shallow
$ cd booleanOperations-shallow/
$ python setup.py sdist
$ pip install -v dist/booleanOperations-0.3.dev88+ng6c3e1f0.zip
$ pip list

Also this seems to be fine:

$ python setup.py --version
0.3.dev88+ng6c3e1f0
$ python -m setuptools_scm
Guessed Version 0.3.dev88+ng6c3e1f0

@anthrotype
Copy link

The generated sdist has the correct Version in PKG_INFO file.
The problem seems to be when pip install-ing from that sdist. Here is the output with SETUPTOOLS_SCM_DEBUG enabled:

$ SETUPTOOLS_SCM_DEBUG=1 pip install -v dist/booleanOperations-0.3.dev88+ng6c3e1f0.zip 
Processing ./dist/booleanOperations-0.3.dev88+ng6c3e1f0.zip
  Running setup.py (path:/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build/setup.py) egg_info for package from file:///Users/cosimolupo/Documents/Github/booleanOperations-shallow/dist/booleanOperations-0.3.dev88%2Bng6c3e1f0.zip
    Running command python setup.py egg_info
    root '/private/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build'
    cmd 'git rev-parse --verify --quiet HEAD'
    err b'fatal: Not a git repository (or any of the parent directories): .git\n'
    ret 128
    cmd 'git status --porcelain --untracked-files=no'
    err b'fatal: Not a git repository (or any of the parent directories): .git\n'
    ret 128
    tag 0.0
    version <Version('0.0')>
    version 0.0
    scm version <ScmVersion 0.0 d=0 n=None d=False x={}>
    config {'version_scheme': 'guess-next-dev', 'local_scheme': 'node-and-date'}
    ep ('setuptools_scm.version_scheme', 'guess-next-dev')
    ep ('setuptools_scm.local_scheme', 'node-and-date')
    version 0.1.dev0
    local_version
    running egg_info
    creating pip-egg-info/booleanOperations.egg-info
    writing top-level names to pip-egg-info/booleanOperations.egg-info/top_level.txt
    writing pip-egg-info/booleanOperations.egg-info/PKG-INFO
    writing requirements to pip-egg-info/booleanOperations.egg-info/requires.txt
    writing dependency_links to pip-egg-info/booleanOperations.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/booleanOperations.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    looking for ep setuptools_scm.files_command /private/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build
    reading manifest file 'pip-egg-info/booleanOperations.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files found matching '.travis.yml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching '.gitignore'
    writing manifest file 'pip-egg-info/booleanOperations.egg-info/SOURCES.txt'
  Source in /var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build has version 0.1.dev0, which satisfies requirement booleanOperations==0.1.dev0 from file:///Users/cosimolupo/Documents/Github/booleanOperations-shallow/dist/booleanOperations-0.3.dev88%2Bng6c3e1f0.zip
Requirement already satisfied (use --upgrade to upgrade): pyclipper>=1.0.5 in /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages (from booleanOperations==0.1.dev0)
Requirement already satisfied (use --upgrade to upgrade): fonttools>=3.1.2 in /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages (from booleanOperations==0.1.dev0)
Requirement already satisfied (use --upgrade to upgrade): ufoLib>=2.0.0 in /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages (from booleanOperations==0.1.dev0)
Installing collected packages: booleanOperations
  Running setup.py install for booleanOperations
    Running command /usr/local/var/pyenv/versions/booleanOps3/bin/python3.5 -c "import setuptools, tokenize;__file__='/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-8jbvy3bx-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/var/pyenv/versions/booleanOps3/include/site/python3.5/booleanOperations
    root '/private/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build'
    cmd 'git rev-parse --verify --quiet HEAD'
    err b'fatal: Not a git repository (or any of the parent directories): .git\n'
    ret 128
    cmd 'git status --porcelain --untracked-files=no'
    err b'fatal: Not a git repository (or any of the parent directories): .git\n'
    ret 128
    tag 0.0
    version <Version('0.0')>
    version 0.0
    scm version <ScmVersion 0.0 d=0 n=None d=False x={}>
    config {'local_scheme': 'node-and-date', 'version_scheme': 'guess-next-dev'}
    ep ('setuptools_scm.version_scheme', 'guess-next-dev')
    ep ('setuptools_scm.local_scheme', 'node-and-date')
    version 0.1.dev0
    local_version
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/booleanOperations
    copying Lib/booleanOperations/__init__.py -> build/lib/booleanOperations
    copying Lib/booleanOperations/booleanGlyph.py -> build/lib/booleanOperations
    copying Lib/booleanOperations/booleanOperationManager.py -> build/lib/booleanOperations
    copying Lib/booleanOperations/exceptions.py -> build/lib/booleanOperations
    copying Lib/booleanOperations/flatten.py -> build/lib/booleanOperations
    copying Lib/booleanOperations/version.py -> build/lib/booleanOperations
    running install_lib
    creating /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations
    copying build/lib/booleanOperations/__init__.py -> /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations
    copying build/lib/booleanOperations/booleanGlyph.py -> /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations
    copying build/lib/booleanOperations/booleanOperationManager.py -> /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations
    copying build/lib/booleanOperations/exceptions.py -> /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations
    copying build/lib/booleanOperations/flatten.py -> /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations
    copying build/lib/booleanOperations/version.py -> /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations
    byte-compiling /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations/__init__.py to __init__.cpython-35.pyc
    byte-compiling /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations/booleanGlyph.py to booleanGlyph.cpython-35.pyc
    byte-compiling /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations/booleanOperationManager.py to booleanOperationManager.cpython-35.pyc
    byte-compiling /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations/exceptions.py to exceptions.cpython-35.pyc
    byte-compiling /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations/flatten.py to flatten.cpython-35.pyc
    byte-compiling /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations/version.py to version.cpython-35.pyc
    running install_egg_info
    running egg_info
    writing top-level names to Lib/booleanOperations.egg-info/top_level.txt
    writing Lib/booleanOperations.egg-info/PKG-INFO
    writing dependency_links to Lib/booleanOperations.egg-info/dependency_links.txt
    writing requirements to Lib/booleanOperations.egg-info/requires.txt
    warning: manifest_maker: standard file '-c' not found

    looking for ep setuptools_scm.files_command /private/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build
    reading manifest file 'Lib/booleanOperations.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files found matching '.travis.yml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching '.gitignore'
    writing manifest file 'Lib/booleanOperations.egg-info/SOURCES.txt'
    Copying Lib/booleanOperations.egg-info to /usr/local/var/pyenv/versions/booleanOps3/lib/python3.5/site-packages/booleanOperations-0.1.dev0-py3.5.egg-info
    running install_scripts
    writing list of installed files to '/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-8jbvy3bx-record/install-record.txt'
  Removing source in /var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pip-p9l6nv15-build
Successfully installed booleanOperations-0.1.dev0
Cleaning up...

@anthrotype
Copy link

@RonnyPfannschmidt I managed to isolate the issue. It seems like in the custom parse function I also have to check if I'm inside a source distribution, in which case I have to return None, so that setuptools_scm can parse the fallback version from the PKG-INFO:

anthrotype/booleanOperations@74757f3

@RonnyPfannschmidt
Copy link
Contributor Author

@anthrotype that looks like a bug, parse should return none if there is no repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants