Commit Graph

50 Commits

Author SHA1 Message Date
Stephen Finucane 915e62ef7b trivial: Fix file permissions
No reason for these to be executable.

Change-Id: I9b22f4b9e679a5f618bb3f2a007327bdb0c80305
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-07-18 10:12:17 +01:00
Monty Taylor 71bea435b6 Move d2to1 more into the source tree
When we merged in d2to1, we kept it separate, but I don't think there
is a great benefit to doing that.

Change-Id: I3972b3132619e8e2dd7e362ca5fe9d1e3add43b8
2013-07-21 10:20:03 -07:00
Monty Taylor 746b78d637 Clean up hacking and path issues with d2to1
We imported in another code base. It takes a little bit of path
adjusting to get things right.

Change-Id: Ifb96652c822d5d243a6bedb77bc34e919be2d3a8
2013-07-11 15:02:12 -04:00
Monty Taylor fa4f46e39c Remove explicit depend on distribute.
Things in the world are moving towards setuptools 0.7, and
there is not a path between distribute and setuptools. Our explicit
dependency on setuptools is causing us to have to write patches to
try to jump through additional hoops to get it to install in the
right contexts.

Fixes bug 1189941

Change-Id: Id7a749c02203100dab52160a551d3548c8a48fd6
2013-06-11 08:17:55 -07:00
Monty Taylor d1c53ddad7 Use pip instead of easy_install for installation.
If we're running the installation of dependencies for installation
ourselves anyway - just use pip and be done with it. This means
that our requirements will get installed consistently regardless of
whether we're using pip, python setup.py install or a tox environment.

Change-Id: If92557a33a76553ad36bd136fa87780857a894b1
2013-06-10 21:31:47 -07:00
Monty Taylor 9bd7716b2b Update to d2to1 0.2.10.
We fixed a string bug upstream which was released, and also added some
additional backwards_compat options.

Change-Id: I636a47952a90e6e0df864dbdc9243b77eeb6d77e
Reviewed-on: https://review.openstack.org/26968
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2013-05-06 16:45:03 +00:00
Monty Taylor 5161ca2ac6 Move sphinx to test-reuqirements.
Change-Id: I15ffeec34cdf9be24ffade5701b8e723aaaa171c
2013-03-12 11:23:43 -04:00
Monty Taylor caf4be4778 Just use d2to1 via hooks mechanism.
It turns out we can just have only our code and use d2to1 directly.

Change-Id: I4700ad51bf4377797ede55d3cf5ec09f424874ed
2013-03-11 18:13:45 -04:00
Monty Taylor 8a4789883a Fix things up to work with nova.
Add extern/six back - turns out setup_requires isn't transitive.
Make sure .gitignore is right.
2013-03-10 21:14:15 -04:00
Monty Taylor aa4641f0e6 Split out oslo.packaging.
Include logic taken from d2to1 to allow us to inject into setup.py. Combined
with ols openstack/common/setup.py code.

Change-Id: I27b341403bb8245e38f8e3c386f1a835b90b1843
2013-03-10 18:02:43 -04:00
Davanum Srinivas e0cc5f8ab9 openstack.common.setup: fails to get version from git
quantum run_tests.py fails because
openstack.common.setup._get_version_from_git fails.  It is because
quantum unit tests run under quantum/tests/unit instead of git root dir.
So the function should check parent dirs for .git.
cinder folks seem to have hit this bug (1125416).

ERROR: test_network_gateway_update (quantum.tests.unit.nicira.test_networkgw.NetworkGatewayExtensionTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "quantum/quantum/tests/unit/nicira/test_networkgw.py", line 70, in setUp
    config.parse(args=args)
  File "quantum/quantum/common/config.py", line 99, in parse
    version='%%prog %s' % quantum_version.release_string())
  File "quantum/quantum/openstack/common/version.py", line 63, in release_string
    self.release = self._get_version_from_pkg_resources()
  File "quantum/quantum/openstack/common/version.py", line 56, in _get_version_from_pkg_resources
    return setup.get_version(self.package)
  File "quantum/quantum/openstack/common/setup.py", line 334, in get_version
    raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository.

Change-Id: I2e24c00b5ba8f35381cac081ff72d86ea0d75d19
Fixes: bug #1131162 and bug #1125416
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2013-02-25 16:16:55 +09:00
Robert Myers ba9731f371 Change the check for the existence of .git directory.
In common setup the check for the .git directory is too
restrictive. Instead of checking that it is a directory just
check to see if it exists. That way if the project is part
of a submodule it will continue to work correctly.

Change-Id: If6b6531ab5778ac17537e3f18bde1844620c8316
Fixes: bug 1126416
2013-02-15 14:32:07 -06:00
Davanum Srinivas ad8a8de3c9 returncode for Popen is valid only after communicate call
Found when testing a bug in cinder (1125416), code
relying on throw_on_error won't work because returncode
is None if checked before the communicate() method is
called

Change-Id: I8c9dd00396346ec3ad7bbe1dc17643c385da8d6f
2013-02-15 10:46:18 -05:00
Monty Taylor 57a947452c Allow running test in uninstalled source tree.
It was pointed out that we missed the use-case that running tests
in a fresh tree checkout should work - and we missed that by
reaching too far into the setup module interface. Shame on us.

Change-Id: Ic0056a3113b308f063d927484e1e4a44c9316a2d
2013-02-10 04:21:24 -06:00
Dirk Mueller 2d5afe991f Fix Pep8 Warning
Fixes
E271 multiple spaces after keyword "return  _run_shell_command("

Change-Id: Ic6b2c88a0b7cabd04341d073ef837a13c1bb7a29
2013-01-28 18:18:03 +01:00
Mark McLoughlin d220011329 setup: count revs for revno if there are no tags
We currently use 'git describe --always' to figure out the number of
commits there have been leading up to the HEAD commit.

However, if there are no tags in the repo, git-describe just returns
the sha hash of HEAD and we fail.

In that case, use 'git rev-list HEAD | wc -l' so we can be  #winning.

Change-Id: I345e0ee32189504276b3dfd3367057ce1d4a2b06
2013-01-25 17:24:24 +00:00
Monty Taylor 38faaa9045 Use revno and git sha for pre-release versioning.
In discussions with ttx and zul, it became clear that the git describe info
for our intra-release case wasn't providing any value and was providing
confusion. Additionally, plain git sha's are not providing enough info.

So, the scheme settled on that breaks the least amount of things and yet
still reduces complexity is:

if pre-version: # server projects
  try:
    use current tag
  except:
    use pre-version+revcount+gitsha
else:
  use git describe | s/-/./

Additionally, we'll use a as a prefix for the revcount, b as the prefix for
the milestone portion of a milestone tag, and rc as the prefix for rc's, so
that for our releases, python version sorting works as expected.

Change-Id: I6f0fe029d225afa8f435bc83216fc144c2402ae0
2013-01-18 16:49:50 -05:00
Monty Taylor 6059356043 Add env var version override for packagers.
Fixes bug 1100805.

Change-Id: I8c8ba8610ed2d9093e188c1412e9689314560015
2013-01-18 13:47:59 -05:00
Steven Hardy 6a5e5db464 trivial pep whitespace fix
Fix multiple spaces after keyword pep8 error, causes our pep8
gate to fail (pep8 1.3.4)

Change-Id: I67ab86ce17a1a91f8dab61efb18b83b22d2e1488
Signed-off-by: Steven Hardy <shardy@redhat.com>
2013-01-18 10:59:03 +00:00
Jenkins 1ba2dd7a02 Merge "Remove write_requirements" 2013-01-18 07:13:47 +00:00
Jenkins f17885f3cb Merge "use regexp to parse the mailmap" 2013-01-17 13:12:18 +00:00
Monty Taylor fd843b2e8b Remove write_requirements
Everyone hated this, so we decided to get rid of it at the last summit.
Actually, come to think of it, I think we decied to get rid of it in San Fran.

Change-Id: I7d93af1eb98a37ff018730669731a7ee22516279
2013-01-16 18:27:09 -05:00
Johannes Erdfelt 11b1f61cfc Stop using no longer valid -E option for pip
Fixes bug 1100403

Version 1.1 of pip dropped the -E option. It's not necessary anyway since
running pip in a correctly setup virtualenv will automatically do the right
thing.

Change-Id: Ifec9f27b8dc169d594125a0808126abe77ed42e7
2013-01-16 18:05:50 +00:00
Ionuț Arțăriși 1773f0b17a use regexp to parse the mailmap
this also makes parse_mailmap() work with the swift .mailmap and should
be more readable

Change-Id: I3abb2a18d655e507bee5f621ebc64421d943cf0b
2013-01-16 15:06:59 +01:00
Monty Taylor f1f6b71d75 Simplify version processing.
In response to the cessation of per-commit tarballs produced by the CI
systems, simplify the version processing code. We did many many many
complicated things to support producing release artifacts that were not
actually supported release artifacts. After a bunch of issues emerged, it was
determined that the best way forward was to stop producing quasi-not-really
non-release tarballs. If people want to consume versions of openstack that
are not released versions, the git repos are always available.

Additionally, this patch removes versioninfo and just uses PKG-INFO and
pkg_resources to handle version processing.

Change-Id: I5c799f3520adb2ba5288d852543706d81a92f8a1
2013-01-11 17:34:13 -08:00
Monty Taylor 322214d03a Add a latex command to our sphinx builders.
The libra project added this locally and use it for some docs they make. It
seemed like something we could add what we provide globally.

Change-Id: I219829693568362bbe01354a8f477a10031754c4
2013-01-04 14:39:11 -05:00
Yaguang Tang 3587e1d175 Fixes setup compatibility issue on Windows
Fixes Bug #1052161

"python setup.py build" fails on Windows due to a hardcoded shell path:
/bib/sh.

Change-Id: Iee0a1fcbdabfd469e92fa73002763d419e75ec27
2012-11-03 18:18:13 +08:00
Monty Taylor 07120fad91 Fix a logic error in stable version calculation.
Milestone information in blank for stable branches, so there is no milestone
prefix. However, we were blindly concatenating the milestone version
prefix onto the datestamp.

Fixes bug 1059634.

Change-Id: I6cff4ee7f6c1dc970397b66fd2d15fa22b0a63a3
2012-10-26 11:07:26 -04:00
David Ripton 01de1955dc Fix a couple of file handle leaks, using with statements.
In practice unclosed file handle leaks are not a huge deal in CPython code,
because reference counting means they get closed automatically in a timely
manner.  But they're bad style, and they can become a real problem if the
code is run with a version of Python that doesn't use reference counting.

Change-Id: Ie54b979e26ffc9dd405871ee07c50b304cb36c67
2012-10-17 10:39:02 -04:00
Doug Hellmann e43a70a236 Ignore the stackforge jenkins email address
Update generate_authors to ignore the email address
for the stackforge jenkins as well as the main openstack
jenkins, to ignore commits in the history of projects
that were on stackforge before moving over to the
main server (such as ceilometer).

Change-Id: I86d93ba0f358d5d33278847ba8de039642dd54b7
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-09-28 15:55:57 -04:00
Bhuvan Arumugam 4713c9b53c Fix errors reported by pyflakes.
* openstack/common/setup.py
  get_reqs_from_files(): Remove unused variable.
  get_reqs_from_files(): Use local variables in a conventional
  way, to prevent errors like:
  local variable 'datestamp' is assigned to but never used.

Change-Id: I44e137d383b96e1601b7bded1e36e84ff14a8f68
2012-08-01 09:43:22 -07:00
Jenkins c8ea903532 Merge "Add SKIP_GENERATE_AUTHORS option to setup.py" 2012-07-13 15:13:44 +00:00
Dan Prince 356145981b Add SKIP_GENERATE_AUTHORS option to setup.py
Updates the generate_authors function in setup.py so that
it will skip generation of the authors file if the
SKIP_GENERATE_AUTHORS env variable is set.

Authors doesn't currently take that long to generate but having
the option to explicitly skip it (regardless of whether .git is there)
seems like a good addition.

Change-Id: Ie18064d2450cecc86f18d0b10e1ce473253d1a51
2012-07-13 11:00:15 -04:00
Dan Prince 621ee29407 Add SKIP_WRITE_GIT_CHANGELOG option to setup.py
Updates the write_git_changelog function in setup.py so that
it will skip changelog generation if the SKIP_WRITE_GIT_CHANGELOG
env variable is set.

The motivation for this change is to speed up running sdist which
gets executed at the begining of a tox run. Some projects (like Nova)
can take between 10-20 seconds to generate a changelog in this fashion.

Change-Id: I2e75060d303bc8fae784129e8e42f09922a8b09e
2012-07-13 09:38:59 -04:00
Monty Taylor 4ae0a34c62 Fix up pre-versioning based on testing in glance.
Change-Id: I137fee43509f079cb4b2def452cf23b6705cdda5
2012-07-09 11:00:04 -05:00
Joe Gordon 8bb4c38cce Fix mailmap.
Mailmap was broken in 01cec1dcb1a0b8d6a0ba098f8e18ab3c0f7cabab

Revert offending line only to get unit tests passing again.

Change-Id: I33e8d5d3587b429d44ae60f34ca2f132ce233793
2012-06-28 15:55:31 -07:00
Monty Taylor a608eaf4d4 Split read_versioninfo into a method.
Change-Id: Iec1f9776b6e6fcccdc21b2e67754fff1da23458a
2012-06-26 21:07:18 -05:00
Monty Taylor 65efad1dec Add support for tag based versioning.
Versions driven by git.
If the current revision is tagged, then that's the version cut.
If not, for post-versioning, the current version is the tag plus an count of the
revs since the tag.
For pre-versioning, it's the logic that's in create-tarball.sh.
Additionally, a versioninfo file is added to the tree so that pkg-resources
can find out what the version is.

Change-Id: I5991345735fa14666305538c556b519160b02b4b
2012-06-24 16:49:41 -05:00
Dan Prince e2ff92ca48 Skip argparse when injecting requirements.
Also adds some unit tests parse_requirements.

Change-Id: I3d8625d4627c7933d73059a63f96e19f8d9647ab
2012-06-20 12:43:32 -04:00
Monty Taylor 2bc00f150d Add autodoc generation to the build_sphinx command
The logic is pulled from the nova code, but has been abstracted
from being nova specific. It allows us to duplicate less info,
because we know a lot of the meta information in setup.py anyway.

Once this is in, we'll get autodoc module information everywhere
pretty much for free, and we can delete the doc/ext dir and the
doc/*sh from nova. (thanks to bcwaldon for pushing things to be
better)

Change-Id: I4c55c370ea6c3790958b5412e21e3378f4474104
2012-06-14 13:56:46 -04:00
Monty Taylor 4572286e39 Added support for proper bare URLs.
If we want to use github zipballs as a source of depends sometimes
(which we do) - we need to have the pip-requires parsing understand
that lines starting with http:// or https:// are urls and should go
to dependency_links.

Change-Id: I9218159872d6edfebd4b820e6db912e9aabdf7d7
2012-05-25 17:35:00 -04:00
Zhongyue Luo eb2bbadebb Backslash continuation removal (common folsom-1)
Fixes bug #1001361

Removes backslash continuations

Change-Id: I86fbb950b48a7681b3c1a010b0d0007cd2f12632
2012-05-19 01:20:14 +08:00
Monty Taylor 03893be94b Encapsulate common sdist actions into a cmdclass.
The pattern of running generate_authors and write_git_changelog
at sdist time is (and should be) repeated in all project's setup.py.
Instead of copying the creation of the two classes and injection
of them into a cmdclass dict, we can do it here and have it
be consistent.

Related to bug 986462.

Change-Id: I0b7b44d58685551482f874b2a6091dec29e6bed6
2012-05-06 11:42:56 -07:00
Bhuvan Arumugam 51c2ee33fe Truly handle mailmap entries for all combinations.
Bug: 994957

Mailmap might contain mapping with full name. This commit fixes
it to handle these combinations:
  Foo ZZ <email@foo.com> Bar YY <email@bar.com>
  Foo <email@foo.com> Bar <email@bar.com>
  <email@foo.com> <email@bar.com>

This is inline with mailmap convention described here:
  http://man.github.com/git/git-shortlog.html

* openstack/common/setup.py
  parse_mailmap(): Pull out canonical and alias email addresses.

Change-Id: Iabe9612efecbd18f7a5b0725de7d2515ab24125d
2012-05-04 22:24:35 -07:00
Bhuvan Arumugam a50701f91a Handle authors existed before VCS was around.
Bug: 976267

The list of such authors are stored in AUTHORS.in file. When
auto generating AUTHORS file, include them as well.

* openstack/common/setup.py
  __doc__: For all methods, remove space and include period.
  generate_authors(): If AUTHORS.in file exist, append the
  content to AUTHORS file.

Change-Id: I05da1e561383cc151e7ef34e75a4600e3afdda6e
2012-04-30 10:01:19 -07:00
Bhuvan Arumugam 0417e9f0ca Add AUTHORS generation function.
Change-Id: I0adbf0755a0191c7b68af9ca2f6e50c787ee7043
2012-04-12 09:14:26 -07:00
Monty Taylor 2a6be97901 Add git changelog method.
Change-Id: I71d99f00b2154bf151a1521016118ba6bd088f79
2012-02-09 10:29:16 -08:00
Monty Taylor 225107526b Add git vcsversion method.
Leaving in the branch_nick for now - I think we need to go through the
projects using this code and ensure that they aren't going to get screwed
before we remove it.

Change-Id: Ib91b5af050244f44cd811ca47cb6e2c53ef74ddb
2012-02-09 10:11:12 -08:00
Monty Taylor fbaefc8bcb Updated tox config for multi-python testing.
Change-Id: Ib1f768c6783db0e63cb51dfc767ae5a31a295c76
2012-02-06 08:06:12 -08:00
Monty Taylor a0da360499 Split functions to avoid eventlet import.
Some of these functions are used in setup.py. In a virtualenv
based workflow, python setup.py sdist is called to create a
tarball which is then installed into the virtualenv. These
functions need to be in a separate file so that they can be
imported by setup.py without eventlet needing to be installed.

Change-Id: I6f7dc9614895b8c91135c62373b98afe55e1fc7d
2012-02-06 08:04:41 -08:00