From 37b436f2bcae9a7a51e96e8d521b08448a3d5c63 Mon Sep 17 00:00:00 2001 From: "John M. Horan" Date: Mon, 5 Feb 2018 10:38:55 -0800 Subject: [PATCH] Troubleshoot initial release code #48 Signed-off-by: John M. Horan --- .bumpversion.cfg | 5 ++ CHANGELOG.rst | 6 ++ MANIFEST.in | 9 +-- MANIFEST.in.dev | 9 +++ NOTICE.txt | 32 +++++++--- etc/release/MANIFEST.in.release | 9 +++ etc/release/release.sh | 105 ++++++++++++++++++++++++++++++++ etc/release/setup.cfg.release | 12 ++++ setup.cfg | 82 +------------------------ setup.cfg.dev | 12 ++++ 10 files changed, 183 insertions(+), 98 deletions(-) create mode 100644 .bumpversion.cfg create mode 100644 CHANGELOG.rst create mode 100644 MANIFEST.in.dev create mode 100644 etc/release/MANIFEST.in.release create mode 100644 etc/release/release.sh create mode 100644 etc/release/setup.cfg.release create mode 100644 setup.cfg.dev diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..5997cb0f --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,5 @@ +[bumpversion] +current_version = 0.0.1.beta +files = setup.py src/deltacode/__init__.py +commit = False +tag = False \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 00000000..e3e92f43 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,6 @@ +Changelog +========= + +0.0.1.beta (2018-02-05) +------------------ +This is the initial beta release. \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 9daf1d53..c284b262 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,16 +1,9 @@ -graft docs graft src -graft ci graft tests include .bumpversion.cfg include CHANGELOG.rst -include NOTICE include deltacode.ABOUT -include README.rst - -include tox.ini .travis.yml appveyor.yml - -global-exclude *.py[co] __pycache__ *.so *.pyd +include .travis.yml diff --git a/MANIFEST.in.dev b/MANIFEST.in.dev new file mode 100644 index 00000000..c284b262 --- /dev/null +++ b/MANIFEST.in.dev @@ -0,0 +1,9 @@ +graft src +graft tests + +include .bumpversion.cfg + +include CHANGELOG.rst +include deltacode.ABOUT + +include .travis.yml diff --git a/NOTICE.txt b/NOTICE.txt index 94afdc56..aa8ae413 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -2,10 +2,10 @@ Software license ================ Copyright (c) 2017 nexB Inc. and others. All rights reserved. -http://nexb.com and https://github.com/nexb/deltacode/ -The Conan software is licensed under the Apache License version 2.0. -Data generated with Conan require an acknowledgment. -Conan is a trademark of nexB Inc. +http://nexb.com and https://github.com/nexB/deltacode/ +The DeltaCode software is licensed under the Apache License version 2.0. +Data generated with DeltaCode require an acknowledgment. +DeltaCode is a trademark of nexB Inc. You may not use this software except in compliance with the License. You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 @@ -14,21 +14,35 @@ 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. +When you publish or redistribute any data created with DeltaCode or any DeltaCode +derivative work, you must accompany this data with the following acknowledgment: + + Generated with DeltaCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES + OR CONDITIONS OF ANY KIND, either express or implied. No content created from + DeltaCode should be considered or used as legal advice. Consult an Attorney + for any legal advice. + DeltaCode is a free software codebase-comparison tool from nexB Inc. and others. + Visit https://github.com/nexB/deltacode/ for support and download. + + Third-party software licenses ============================= -Conan embeds third-party free and open source software packages under various +DeltaCode embeds third-party free and open source software packages under various licenses including copyleft licenses. Some of the third-party software packages are delivered as pre-built binaries. The origin and license of these packages is documented by .ABOUT files. The corresponding source code for pre-compiled third-party software is available -as part of this download. +for immediate download from the same release page where you obtained DeltaCode at: +https://github.com/nexB/deltacode/ +or https://github.com/nexB/deltacode-thirdparty-src/ You may also contact us to request the source code by email at info@nexb.com or by postal mail at: - nexB Inc., Conan open source code request + + nexB Inc., DeltaCode open source code request 735 Industrial Road, Suite #101, 94070 San Carlos, CA, USA -Please indicate in your communication the Conan version for which you are -requesting source code. +Please indicate in your communication the DeltaCode version for which you are +requesting source code. diff --git a/etc/release/MANIFEST.in.release b/etc/release/MANIFEST.in.release new file mode 100644 index 00000000..c284b262 --- /dev/null +++ b/etc/release/MANIFEST.in.release @@ -0,0 +1,9 @@ +graft src +graft tests + +include .bumpversion.cfg + +include CHANGELOG.rst +include deltacode.ABOUT + +include .travis.yml diff --git a/etc/release/release.sh b/etc/release/release.sh new file mode 100644 index 00000000..7f359790 --- /dev/null +++ b/etc/release/release.sh @@ -0,0 +1,105 @@ +#!/bin/bash +# +# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved. +# + +# ScanCode release script +# This script creates and tests release archives in the dist/ dir + +set -e + +# un-comment to trace execution +set -x + +echo "### BUILDING ScanCode release ###" + +echo " RELEASE: Cleaning previous release archives, then setup and config: " +rm -rf dist/ build/ + +# backup dev manifests +cp MANIFEST.in MANIFEST.in.dev +cp setup.cfg setup.cfg.dev + +# install release manifests +cp etc/release/MANIFEST.in.release MANIFEST.in +cp etc/release/setup.cfg.release setup.cfg + +./configure --clean +export CONFIGURE_QUIET=1 +# ./configure etc/conf --no-reindex-licenses + +echo " RELEASE: Building release archives..." + +# build a zip and tar.bz2 +bin/python setup.py --quiet release --use-default-version +# try this +# bin/python setup.py --quiet release +# bin/python setup.py release --use-default-version +# bin/python setup.py release +# 2/4/2018 10:51:38 PM Looks like 'release' forces me to register with PyPI, so try w/o +# bin/python setup.py --use-default-version +# bin/python setup.py + +echo " reached step 1..." + +# restore dev manifests +mv MANIFEST.in.dev MANIFEST.in +mv setup.cfg.dev setup.cfg + + +function test_scan { + # run a test scan for a given archive + file_extension=$1 + extract_command=$2 + for archive in *.$file_extension; + do + echo " RELEASE: Testing release archive: $archive ... " + $($extract_command $archive) + extract_dir=$(ls -d */) + cd $extract_dir + + # this is needed for the zip + chmod o+x scancode extractcode + # Try this: + # chmod o+x deltacode extractcode + + # # minimal test: update when new scans are available + # ./scancode --quiet -lcip apache-2.0.LICENSE test_scan.json + # echo "TEST JSON passed: ./scancode --quiet -lcip apache-2.0.LICENSE test_scan.json" + # ./scancode --quiet -lcip --format json-pp apache-2.0.LICENSE test_scan.json + # echo "TEST JSON-PP passed: ./scancode --quiet -lcip --format json-pp apache-2.0.LICENSE test_scan.json" + # ./scancode --quiet -lcip --format html apache-2.0.LICENSE test_scan.html + # echo "TEST HTML passed: ./scancode --quiet -lcip --format html apache-2.0.LICENSE test_scan.html" + # ./scancode --quiet -lcip --format html-app apache-2.0.LICENSE test_scan_app.html + # echo "TEST HTML-APP passed: ./scancode --quiet -lcip --format html-app apache-2.0.LICENSE test_scan_app.html" + # ./extractcode --quiet samples/arch + # echo "TEST EXTRACTCODE passed: ./extractcode --quiet samples/arch" + + # 2/4/2018 10:51:38 PM Throws an error? Try w/o + ./deltacode --help + echo "TEST JSON passed: ./deltacode --help" + + # cleanup + cd .. + rm -rf $extract_dir + echo " RELEASE: Success" + done +} + +# 2/4/2018 10:57:49 PM Don't we need to create the dist directory? +mkdir dist + +cd dist +if [ "$1" != "--no-tests" ]; then + echo " RELEASE: Testing..." + test_scan bz2 "tar -xf" + test_scan zip "unzip -q" +else + echo " RELEASE: !!!!NOT Testing..." +fi + + +echo "### RELEASE is ready for publishing ###" + +set +e +set +x \ No newline at end of file diff --git a/etc/release/setup.cfg.release b/etc/release/setup.cfg.release new file mode 100644 index 00000000..d7b9ece6 --- /dev/null +++ b/etc/release/setup.cfg.release @@ -0,0 +1,12 @@ +[bdist_wheel] +universal = 1 + +[metadata] +license_file = NOTICE.txt + +[aliases] +release = register clean --all sdist bdist_wheel upload + +[flake8] +max-line-length = 140 +exclude = tests/* \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 06efac16..d7b9ece6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,84 +9,4 @@ release = register clean --all sdist bdist_wheel upload [flake8] max-line-length = 140 -exclude = tests/* - -[tool:pytest] -norecursedirs = - .git - .tox - dist - build - thirdparty - local - ci - docs - etc - Include - include - Lib - lib - bin - Scripts - tmp - .cache - data - src/data - tests/data - -python_files = *.py - -python_classes=Test -python_functions=test - -addopts = - -rfEsxX - --strict - -s - -vv - --ignore docs/conf.py - --ignore setup.py - --doctest-modules - -[isort] -force_single_line=True -line_length=120 -known_first_party=licensedcode -default_section=THIRDPARTY -forced_separate=test_licensedcode - -[matrix] -# This is the configuration for the `./bootstrap.py` script. -# It generates `.travis.yml`, `tox.ini` and `appveyor.yml`. -# -# Syntax: [alias:] value [!variable[glob]] [&variable[glob]] -# -# alias: -# - is used to generate the tox environment -# - it's optional -# - if not present the alias will be computed from the `value` -# value: -# - a value of "-" means empty -# !variable[glob]: -# - exclude the combination of the current `value` with -# any value matching the `glob` in `variable` -# - can use as many you want -# &variable[glob]: -# - only include the combination of the current `value` -# when there's a value matching `glob` in `variable` -# - can use as many you want - -python_versions = - 2.7 - 3.4 - pypy - -dependencies = - - - -coverage_flags = - : true - nocover: false - -environment_variables = - - +exclude = tests/* \ No newline at end of file diff --git a/setup.cfg.dev b/setup.cfg.dev new file mode 100644 index 00000000..d7b9ece6 --- /dev/null +++ b/setup.cfg.dev @@ -0,0 +1,12 @@ +[bdist_wheel] +universal = 1 + +[metadata] +license_file = NOTICE.txt + +[aliases] +release = register clean --all sdist bdist_wheel upload + +[flake8] +max-line-length = 140 +exclude = tests/* \ No newline at end of file