Follow up for clean up oslo-incubator code
We clean up oslo-incubator in 90ae25e38915cc502d9e9c52d59e8fb668a72ae1, There are some obsolete things to clean. * Remove api maintainers file and check script * Remove sync tool with copy code to other openstack project. * Remove graduate script * remove section entry_points in setup.cfg * Clean test related stuff in tox.ini * Remove requirements.txt/test-requirements.txt Change-Id: If79def1607c81a51f3e7e607620fae3995c79358
This commit is contained in:
parent
84fcfc83e2
commit
29d3dbd449
|
@ -1,77 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Copyright 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Parse MAINTAINERS file
|
||||
maintainers = {}
|
||||
module_template = {'maintainers': [],
|
||||
'status': '',
|
||||
'files': [],
|
||||
}
|
||||
with open('MAINTAINERS', 'r') as maintainers_file:
|
||||
for line in maintainers_file:
|
||||
if line.startswith('=='):
|
||||
module_name = line[3:-4]
|
||||
maintainers[module_name] = copy.deepcopy(module_template)
|
||||
elif line.startswith('M:'):
|
||||
maintainer_name = line[3:]
|
||||
maintainers[module_name]['maintainers'] = maintainer_name
|
||||
elif line.startswith('S:'):
|
||||
status = line[3:]
|
||||
maintainers[module_name]['status'] = status
|
||||
elif line.startswith('F:'):
|
||||
filename = line[3:-1]
|
||||
maintainers[module_name]['files'].append(filename)
|
||||
|
||||
# Check that all files in the tree are covered in MAINTAINERS
|
||||
return_value = 0
|
||||
|
||||
|
||||
def find_directory(directory):
|
||||
for module, values in maintainers.items():
|
||||
if (directory + '/') in values['files']:
|
||||
return
|
||||
print('Directory %s not found in MAINTAINERS' % directory)
|
||||
global return_value
|
||||
return_value = 1
|
||||
|
||||
|
||||
def find_file(filename):
|
||||
for module, values in maintainers.items():
|
||||
if filename in values['files']:
|
||||
return
|
||||
print('File %s not found in MAINTAINERS' % filename)
|
||||
global return_value
|
||||
return_value = 1
|
||||
|
||||
|
||||
def check_directory(path):
|
||||
skipped_entries = ['__init__.py', 'deprecated', '__pycache__', '_i18n.py']
|
||||
for i in os.listdir(path):
|
||||
if i.endswith('.pyc') or i in skipped_entries:
|
||||
continue
|
||||
if os.path.isdir(os.path.join(path, i)):
|
||||
find_directory(i)
|
||||
elif os.path.isfile(os.path.join(path, i)):
|
||||
find_file(i)
|
||||
|
||||
|
||||
check_directory('openstack/common')
|
||||
|
||||
sys.exit(return_value)
|
91
graduate.sh
91
graduate.sh
|
@ -1,91 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Use this script to prune a copy of oslo-incubator when graduating
|
||||
# modules to a brand new library.
|
||||
#
|
||||
# To use:
|
||||
#
|
||||
# 1. Clone a copy of the oslo-incubator repository to be manipulated.
|
||||
# 2. Choose the new library name. For "oslo.foo", the argument to the
|
||||
# script is "foo".
|
||||
# 3. cd into the copy of oslo-incubator to be changed.
|
||||
# 4. Run graduate.sh, passing the library name and the names of all
|
||||
# directories and files to be saved (only code and tests, no project
|
||||
# configuration):
|
||||
#
|
||||
# ../oslo-incubator/tools/graduate.sh foo openstack/common/foo.py tests/unit/test_foo.py ...
|
||||
#
|
||||
# 5. Clean up the results a bit by hand to make the tests work
|
||||
# (update dependencies, etc.).
|
||||
#
|
||||
|
||||
# Stop if there are any command failures
|
||||
set -e
|
||||
|
||||
bindir=$(dirname $0)
|
||||
tmpdir=$(mktemp -d -t oslo-graduate.XXXX)
|
||||
mkdir -p $tmpdir
|
||||
logfile=$tmpdir/output.log
|
||||
echo "Logging to $logfile"
|
||||
|
||||
# Redirect stdout/stderr to tee to write the log file
|
||||
# (borrowed from verbose mode handling in devstack)
|
||||
exec 1> >( awk '
|
||||
{
|
||||
cmd ="date +\"%Y-%m-%d %H:%M:%S \""
|
||||
cmd | getline now
|
||||
close("date +\"%Y-%m-%d %H:%M:%S \"")
|
||||
sub(/^/, now)
|
||||
print
|
||||
fflush()
|
||||
}' | tee "$logfile" ) 2>&1
|
||||
|
||||
function count_commits {
|
||||
echo
|
||||
echo "Have $(git log --oneline | wc -l) commits"
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
# Handle arguments
|
||||
new_lib="$1"
|
||||
shift
|
||||
files_to_keep="$@"
|
||||
|
||||
# FIXME(dhellmann): Make sure they are not running the tool in the
|
||||
# same copy of the repository where it lives.
|
||||
|
||||
# Filter the repository history down
|
||||
${bindir}/filter_git_history.sh $files_to_keep
|
||||
|
||||
# Move things around
|
||||
echo "Moving files into place..."
|
||||
if [[ -d openstack/common/$new_lib ]]; then
|
||||
git mv openstack/common/$new_lib oslo_${new_lib}
|
||||
else
|
||||
git mv openstack/common oslo_${new_lib}
|
||||
fi
|
||||
rmdir openstack
|
||||
if [[ -d tests ]]; then
|
||||
git mv tests/* oslo_${new_lib}/tests/
|
||||
rmdir tests
|
||||
fi
|
||||
|
||||
# Fix imports after moving files
|
||||
echo "Fixing imports..."
|
||||
if [[ -d oslo_${new_lib} ]]; then
|
||||
find . -name '*.py' -exec sed -i "s/openstack.common.${new_lib}/oslo_${new_lib}/" {} \;
|
||||
else
|
||||
find . -name '*.py' -exec sed -i "s/openstack.common/oslo_${new_lib}/" {} \;
|
||||
fi
|
||||
|
||||
# Bring in any missing files based on the cookiecutter template
|
||||
$bindir/apply_cookiecutter.sh $new_lib
|
||||
|
||||
# Commit the work we have done so far. Changes to make
|
||||
# it work will be applied on top.
|
||||
git add .
|
||||
git commit -m "exported from oslo-incubator by graduate.sh"
|
||||
|
||||
echo "The scratch files and logs from the export are in: $tmpdir"
|
||||
echo "The next step is to make the tests work."
|
|
@ -1,8 +1,7 @@
|
|||
# NOTE(dhellmann): These requirements are just for the tool scripts and
|
||||
# do not need to be synced.
|
||||
|
||||
argparse
|
||||
oslo.config
|
||||
pyyaml
|
||||
jinja2
|
||||
oslo.concurrency
|
||||
parawrap
|
||||
|
|
Loading…
Reference in New Issue