Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Prevent erroneous constraints.txt file checkins #817

Merged
merged 1 commit into from
Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions python/constraints.txt.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file allows our dependencies to be against specific versions
# or git tags. Each line is similar to a requirements.txt line,
# except that when installing the dependencies, the constraints.txt
# is converted into the `dependency_links` of the setuptools
# packaging script. This allows us to maintain dependencies across
# repositories.
#
# For example, during development we use the development version
# of common with the line:
#
# git+git://github.com/ga4gh/ga4gh-common.git@master#egg=ga4gh_common
#
# When one has proposed a common modification, they can change this
# constraint to point at the branch of their proposed change:
#
# git+git://github.com/david4096/ga4gh-common.git@some-branch#egg=ga4gh_common
#
# Then, when the change has been accepted at the common repository
# you can change this to point back at the master branch!
#
# When making a release, these constraints are changed to point at
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that we specifically opted not to do this at the release. Instead the constraints line is deleted and the pinned version is set in the requirements.txt.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to circle back to when we change our documentation (all of the constraints.txt files should have similar instructions... I just copy and pasted them)

# the released dependency.
#
# ga4gh-common==0.1.0
#
git+git://github.com/ga4gh/ga4gh-common.git@master#egg=ga4gh_common
6 changes: 2 additions & 4 deletions tests/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,5 @@ def testCompile(self):
checkedInFilePath)
tempFileShortPath = self._getDirAndFilenameOfPath(tempFilePath)
self.assertEqual(checkedInFileShortPath, tempFileShortPath)
with open(checkedInFilePath) as checkedInFile, \
open(tempFilePath) as tempFile:
for checkedInLine, tempLine in zip(checkedInFile, tempFile):
self.assertEqual(checkedInLine, tempLine)
utils.assertFileContentsIdentical(
checkedInFilePath, tempFilePath)
20 changes: 20 additions & 0 deletions tests/test_constraints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Tests the constraints invariants
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import unittest

import ga4gh.common.utils as utils


class TestConstraints(unittest.TestCase):

constraintsFilePath = 'python/constraints.txt'
constraintsFileDefaultPath = 'python/constraints.txt.default'

def testDefault(self):
utils.assertFileContentsIdentical(
self.constraintsFilePath, self.constraintsFileDefaultPath)