Repository: systemml Updated Branches: refs/heads/master 6ea9b33b4 -> 2e6b577c5
[SYSTEMML-1907] Rename python package to systemml-*-python.tar.gz Switched Python artifact to tar.gz for PyPi upload compatibility with twine. Closes #666. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/2e6b577c Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/2e6b577c Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/2e6b577c Branch: refs/heads/master Commit: 2e6b577c513393022f87e4770d7761a3726a07aa Parents: 6ea9b33 Author: Glenn Weidner <gweid...@us.ibm.com> Authored: Sat Sep 16 14:53:55 2017 -0700 Committer: Glenn Weidner <gweid...@us.ibm.com> Committed: Sat Sep 16 14:53:55 2017 -0700 ---------------------------------------------------------------------- dev/release/release-build.sh | 6 +- dev/release/release-verify.sh | 12 +-- dev/release/src/test/bin/verifyBuild.sh | 6 +- .../org/apache/sysml/validation/Constants.java | 1 + .../sysml/validation/ValidateLicAndNotice.java | 82 ++++++++++---------- docs/beginners-guide-python.md | 4 +- pom.xml | 4 +- src/main/python/post_setup.py | 2 +- 8 files changed, 60 insertions(+), 57 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/dev/release/release-build.sh ---------------------------------------------------------------------- diff --git a/dev/release/release-build.sh b/dev/release/release-build.sh index 120664b..6142e72 100755 --- a/dev/release/release-build.sh +++ b/dev/release/release-build.sh @@ -289,11 +289,11 @@ if [[ "$RELEASE_PREPARE" == "true" ]]; then cd svn-release-staging/$RELEASE_VERSION-$RELEASE_RC/ rm -f *.asc - for i in *.zip *.tgz; do gpg --output $i.asc --detach-sig --armor $i; done + for i in *.zip *.tgz *.tar.gz; do gpg --output $i.asc --detach-sig --armor $i; done rm -f *.md5 - for i in *.zip *.tgz; do openssl md5 -hex $i | sed 's/MD5(\([^)]*\))= \([0-9a-f]*\)/\2 *\1/' > $i.md5; done + for i in *.zip *.tgz *.tar.gz; do openssl md5 -hex $i | sed 's/MD5(\([^)]*\))= \([0-9a-f]*\)/\2 *\1/' > $i.md5; done rm -f *.sha512 - for i in *.zip *.tgz; do shasum -a 512 $i > $i.sha512; done + for i in *.zip *.tgz *.tar.gz; do shasum -a 512 $i > $i.sha512; done cd .. #exit $RELEASE_VERSION-$RELEASE_RC/ http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/dev/release/release-verify.sh ---------------------------------------------------------------------- diff --git a/dev/release/release-verify.sh b/dev/release/release-verify.sh index 6071ae4..f53604c 100755 --- a/dev/release/release-verify.sh +++ b/dev/release/release-verify.sh @@ -36,15 +36,15 @@ This will compile the utility source code which is not on regular source code pa --verifyAll <--tag="Code based on Git tag will be validated."> [--workDir="Directory where output files will be created] This will verify license, notice and binary files. ---verifyLic [--distDir="Directory Containing zip/tgz files] -This will verify license, notice in zip/tgz files. +--verifyLic [--distDir="Directory Containing zip/tgz/tar.gz files] +This will verify license, notice in zip/tgz/tar.gz files. --verifyBin <--tag="Code based on Git tag will be validated."> [--workDir="Directory where output files will be created] This will verify binary distribution files for runtime correctness. OPTIONS ---distDir - Directory containing release artifacts (zip/tzg) files. +--distDir - Directory containing release artifacts (zip/tgz/tar.gz) files. --workDir - Directory where output files will be created. @@ -73,7 +73,7 @@ EOF set -e if [ $# -eq 0 ]; then - echo "`date +%Y-%m-%dT%H:%M:%S`: ERROR: Insuffient parameters passed."; + echo "`date +%Y-%m-%dT%H:%M:%S`: ERROR: Insufficient parameters passed."; exit_with_usage fi @@ -160,7 +160,7 @@ if [[ "$COMPILE_CODE" == "true" ]]; then javac -Xlint:unchecked -classpath ../../../../..//target/lib/commons-compress-1.4.1.jar:../../../../..//target/lib/commons-io-2.4.jar:. org/apache/sysml/validation/*.java - cd "$ORIG_DIR" # Return to directoryt from it was called. + cd "$ORIG_DIR" # Return to directory from it was called. exit 0 fi @@ -180,7 +180,7 @@ if [[ "$BIN_VERIFY" == "true" ]]; then fi if [[ "$LIC_NOTICE_VERIFY" == "true" ]]; then - echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying license and notices from zip/tgz files..." + echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying license and notices from zip/tgz/tar.gz files..." java -classpath ../../../../..//target/lib/commons-compress-1.4.1.jar:../../../../..//target/lib/commons-io-2.4.jar:. org/apache/sysml/validation/ValidateLicAndNotice $DIST_DIR RET_CODE=$? http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/dev/release/src/test/bin/verifyBuild.sh ---------------------------------------------------------------------- diff --git a/dev/release/src/test/bin/verifyBuild.sh b/dev/release/src/test/bin/verifyBuild.sh index 4309aea..c795515 100755 --- a/dev/release/src/test/bin/verifyBuild.sh +++ b/dev/release/src/test/bin/verifyBuild.sh @@ -63,7 +63,7 @@ while getopts "h:" options; do done if [ -z "$1" ] ; then - echo "`date +%Y-%m-%dT%H:%M:%S`: ERROR: Insuffient parameters passed."; # TagName has not passed. + echo "`date +%Y-%m-%dT%H:%M:%S`: ERROR: Insufficient parameters passed."; # TagName has not passed. printUsageExit; fi @@ -171,8 +171,8 @@ runCommand "cd ../../" ## Verify Python scripts through spark-submit echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying Python scripts..." echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying Python scripts..." >> $OUT_FILE -runCommand "pip install --upgrade systemml-$VER_NAME-python.tgz" -runCommand "pip3 install --upgrade systemml-$VER_NAME-python.tgz" +runCommand "pip install --upgrade systemml-$VER_NAME-python.tar.gz" +runCommand "pip3 install --upgrade systemml-$VER_NAME-python.tar.gz" runCommand "cd ../../../" runCommand "$SPARK_HOME/bin/spark-submit src/test/python/matrix_sum_example.py" http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/dev/release/src/test/java/org/apache/sysml/validation/Constants.java ---------------------------------------------------------------------- diff --git a/dev/release/src/test/java/org/apache/sysml/validation/Constants.java b/dev/release/src/test/java/org/apache/sysml/validation/Constants.java index 056ed8f..98dc046 100644 --- a/dev/release/src/test/java/org/apache/sysml/validation/Constants.java +++ b/dev/release/src/test/java/org/apache/sysml/validation/Constants.java @@ -59,6 +59,7 @@ public class Constants public static final String ZIP = "zip"; public static final String TGZ = "tgz"; + public static final String TAR_GZ = "tar.gz"; public static final String LICENSE = "LICENSE"; public static final String NOTICE = "NOTICE"; public static final String JAR = "jar"; http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/dev/release/src/test/java/org/apache/sysml/validation/ValidateLicAndNotice.java ---------------------------------------------------------------------- diff --git a/dev/release/src/test/java/org/apache/sysml/validation/ValidateLicAndNotice.java b/dev/release/src/test/java/org/apache/sysml/validation/ValidateLicAndNotice.java index 391862d..f3068e5 100644 --- a/dev/release/src/test/java/org/apache/sysml/validation/ValidateLicAndNotice.java +++ b/dev/release/src/test/java/org/apache/sysml/validation/ValidateLicAndNotice.java @@ -97,7 +97,7 @@ public class ValidateLicAndNotice } /** - * This will validate all zip and tgz from distribution location. + * This will validate all archives from distribution location. * * @return Returns the output code */ @@ -118,7 +118,7 @@ public class ValidateLicAndNotice List<String> zips = getZipsInDistro(libDirectory); if(zips.size() == 0) { - Utility.debugPrint(Constants.DEBUG_ERROR, "Can't find zip/tgz files in folder: " + libDirectory.getAbsoluteFile().toString()); + Utility.debugPrint(Constants.DEBUG_ERROR, "Can't find archives in folder: " + libDirectory.getAbsoluteFile().toString()); return Constants.NO_ZIP_TGZ; } @@ -126,7 +126,7 @@ public class ValidateLicAndNotice { retCodeForAllFileTypes = Constants.SUCCESS; Utility.debugPrint(Constants.DEBUG_INFO, "======================================================================================"); - Utility.debugPrint(Constants.DEBUG_INFO, "Validating zip file : " + zipFile + " ..."); + Utility.debugPrint(Constants.DEBUG_INFO, "Validating archive: " + zipFile + " ..."); for (String fileType: fileTypes) { retCode = Constants.SUCCESS; @@ -167,29 +167,29 @@ public class ValidateLicAndNotice retCode += Constants.FILE_NOT_IN_LIC; } - // Validate shaded jar and notice only one time for each zip/tgz file. + // Validate shaded jar and notice only one time for each archive. if(fileType == Constants.JAR) { for (String file : fileSysml) retCode += ValidateLicAndNotice.validateShadedLic(libDirectory + "/" + zipFile, file, outTempDir.getAbsolutePath()); if (!validateNotice(outTempDir.getAbsolutePath()+"/"+Constants.NOTICE)) { - Utility.debugPrint(Constants.DEBUG_ERROR, "Notice validation falied, please check notice file manually in this zip/tgz file."); + Utility.debugPrint(Constants.DEBUG_ERROR, "Notice validation failed, please check notice file manually in this archive."); retCode += Constants.INVALID_NOTICE; } if (!validateJSCssLicense(licenseFile, libDirectory + "/" + zipFile)) { - Utility.debugPrint(Constants.DEBUG_ERROR, "JS/CSS license validation falied, please check license file manually in this zip/tgz file."); + Utility.debugPrint(Constants.DEBUG_ERROR, "JS/CSS license validation failed, please check license file manually in this archive."); retCode += Constants.JS_CSS_LIC_NOT_EXIST; } } if (retCode == Constants.SUCCESS) - Utility.debugPrint(Constants.DEBUG_INFO3, "Validation of file type '." + fileType + "' in zip/tgz file : " + zipFile + " completed successfully."); + Utility.debugPrint(Constants.DEBUG_INFO3, "Validation of file type '." + fileType + "' in archive " + zipFile + " completed successfully."); else { - Utility.debugPrint(Constants.DEBUG_ERROR, "License/Notice validation failed for zip/tgz file " + zipFile + " with error code " + retCode + ", please validate file manually."); + Utility.debugPrint(Constants.DEBUG_ERROR, "License/Notice validation failed for archive " + zipFile + " with error code " + retCode + ", please validate file manually."); retCodeForAllFileTypes = Constants.FAILURE; } } if(retCodeForAllFileTypes == Constants.SUCCESS) - Utility.debugPrint(Constants.DEBUG_INFO, "Validation of zip/tgz file : " + zipFile + " completed successfully."); + Utility.debugPrint(Constants.DEBUG_INFO, "Validation of archive " + zipFile + " completed successfully."); retCodeAll = retCodeForAllFileTypes != Constants.SUCCESS?Constants.FAILURE:retCodeAll; } @@ -304,12 +304,12 @@ public class ValidateLicAndNotice } /** - * This will return the list of files in licsense files but not in list of files coming from zip/tgz file. + * This will return the list of files in license files but not in list of files coming from archive. * - * @param licenseFile is the file against which contents of zip/tgz file gets compared. - * @param files are the list of files coming from zip/tgz file. - * @param fileExt is the extention of file to validate (e.g. "jar") - * @return Returns the list of files in License file but not in zip/tgz file. + * @param licenseFile is the file against which contents of archive gets compared. + * @param files are the list of files coming from archive. + * @param fileExt is the extension of file to validate (e.g. "jar") + * @return Returns the list of files in License file but not in archive. */ private List<String> getLICENSEFilesNotInList(File licenseFile, List<String> files, String fileExt) throws IOException { @@ -343,10 +343,10 @@ public class ValidateLicAndNotice } /** - * This will return the list of files in licsense files with specified file extention. + * This will return the list of files in license files with specified file extension. * - * @param licenseFile is the file against which contents of zip/tgz file gets compared. - * @param fileExt is the extention of file to validate (e.g. "jar") + * @param licenseFile is the file against which contents of archive gets compared. + * @param fileExt is the extension of file to validate (e.g. "jar") * @return Returns the list of files in License file. */ private List<String> getFilesFromLicenseFile(File licenseFile, String fileExt) throws IOException { @@ -381,12 +381,12 @@ public class ValidateLicAndNotice } /** - * This will return the list of files coming from zip/tgz file but not in the licsense file. + * This will return the list of files coming from archive but not in the license file. * - * @param licenseFile is the file against which contents of zip/tgz file gets compared. - * @param files are the list of files coming from zip/tgz file. - * @param fileExt is the extention of file to validate (e.g. "jar") - * @return Returns the list of files in zip/tgz file but not in License file. + * @param licenseFile is the file against which contents of archive gets compared. + * @param files are the list of files coming from archive. + * @param fileExt is the extension of file to validate (e.g. "jar") + * @return Returns the list of files in archive but not in License file. */ private List<String> getFilesNotInLICENSE(File licenseFile, List<String> files, String fileExt) throws IOException { List<String> badFiles = new ArrayList<String>(); @@ -400,16 +400,18 @@ public class ValidateLicAndNotice } /** - * This will return the list of zip/tgz files from a directory. + * This will return the list of archives from a directory. * - * @param directory is the location from where list of zip/tgz will be returned. - * @return Returns the list of zip/tgz files from a directory. + * @param directory is the location from where list of archives will be returned. + * @return Returns the list of archives (e.g., .zip/tgz/tar.gz files) from a directory. */ private List<String> getZipsInDistro(File directory) { List<String> zips = new ArrayList<String>(); for (String fileName : directory.list()) - if ((fileName.endsWith("." + Constants.ZIP)) || (fileName.endsWith("." + Constants.TGZ))) + if ((fileName.endsWith("." + Constants.ZIP)) || (fileName.endsWith("." + Constants.TGZ)) || + (fileName.endsWith("." + Constants.TAR_GZ))) { zips.add(fileName); + } return zips; } @@ -434,19 +436,19 @@ public class ValidateLicAndNotice } /** - * This will return the file from zip/tgz file and store it in specified location. + * This will return the file from archive and store it in specified location. * - * @param zipFileName is the name of zip/tgz file from which file to be extracted. + * @param zipFileName is the name of archive from which file to be extracted. * @param fileName is the name of the file to be extracted. * @param strDestLoc is the location where file will be extracted. * @param bFirstDirLevel to indicate to get file from first directory level. * @return Success or Failure */ public static boolean extractFile(String zipFileName, String fileName, String strDestLoc, boolean bFirstDirLevel) { - Utility.debugPrint(Constants.DEBUG_CODE, "Extracting " + fileName + " from jar/zip/tgz file " + zipFileName); + Utility.debugPrint(Constants.DEBUG_CODE, "Extracting " + fileName + " from archive " + zipFileName); if (zipFileName.endsWith("." + Constants.ZIP) || zipFileName.endsWith("." + Constants.JAR)) return extractFileFromZip(zipFileName, fileName, strDestLoc, bFirstDirLevel); - else if (zipFileName.endsWith("." + Constants.TGZ)) + else if (zipFileName.endsWith("." + Constants.TGZ) || zipFileName.endsWith("." + Constants.TAR_GZ)) return extractFileFromTGZ(zipFileName, fileName, strDestLoc, bFirstDirLevel); return Constants.bFAILURE; } @@ -557,16 +559,16 @@ public class ValidateLicAndNotice } /** - * This will return the list of files from zip/tgz file. + * This will return the list of files from archive. * - * @param zipFileName is the name of zip file from which list of files with specified file extension will be returned. + * @param zipFileName is the name of archive (e.g., .zip/tgz/tar.gz file) from which list of files with specified file extension will be returned. * @param fileExt is the file extension to be used to get list of files to be returned. - * @return Returns list of files having specified extention from zip file . + * @return Returns list of files having specified extension from archive. */ public static List<String> getFiles (String zipFileName, String fileExt) { if (zipFileName.endsWith("." + Constants.ZIP)) return getFilesFromZip (zipFileName, fileExt); - else if (zipFileName.endsWith("." + Constants.TGZ)) + else if (zipFileName.endsWith("." + Constants.TGZ) || zipFileName.endsWith("." + Constants.TAR_GZ)) return getFilesFromTGZ (zipFileName, fileExt); return null; } @@ -575,7 +577,7 @@ public class ValidateLicAndNotice * * @param zipFileName is the name of zip file from which list of files with specified file extension will be returned. * @param fileExt is the file extension to be used to get list of files to be returned. - * @return Returns list of files having specified extention from zip file . + * @return Returns list of files having specified extension from zip file. */ public static List<String> getFilesFromZip (String zipFileName, String fileExt) { List<String> files = new ArrayList<String>(); @@ -604,7 +606,7 @@ public class ValidateLicAndNotice * * @param tgzFileName is the name of tgz file from which list of files with specified file extension will be returned. * @param fileExt is the file extension to be used to get list of files to be returned. - * @return Returns list of files having specified extention from tgz file . + * @return Returns list of files having specified extension from tgz file. */ public static List<String> getFilesFromTGZ (String tgzFileName, String fileExt) { @@ -683,10 +685,10 @@ public class ValidateLicAndNotice } /** - * This will validate license for JavaScript & CSS files within a zip/tgz file. + * This will validate license for JavaScript & CSS files within an archive. * - * @param licenseFile is the file against which contents of zip/tgz file gets compared. - * @param zipFileName is the name of zip/tgz file from which list of JavaScript files will be returned. + * @param licenseFile is the file against which contents of archive gets compared. + * @param zipFileName is the name of archive from which list of JavaScript files will be returned. * @return Success or Failure code */ public static boolean validateJSCssLicense(File licenseFile, String zipFileName) throws Exception @@ -807,7 +809,7 @@ public class ValidateLicAndNotice Utility.debugPrint(Constants.DEBUG_INFO, "Return code = " + retCode); } catch (Exception e) { - Utility.debugPrint(Constants.DEBUG_ERROR, "Error while validating license in zip/tgz file." + e); + Utility.debugPrint(Constants.DEBUG_ERROR, "Error while validating license in archive." + e); } } http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/docs/beginners-guide-python.md ---------------------------------------------------------------------- diff --git a/docs/beginners-guide-python.md b/docs/beginners-guide-python.md index 266d50f..173ea63 100644 --- a/docs/beginners-guide-python.md +++ b/docs/beginners-guide-python.md @@ -95,7 +95,7 @@ If you want to try out the bleeding edge version, please use following commands: git checkout https://github.com/apache/systemml.git cd systemml mvn clean package -P distribution -pip install target/systemml-1.0.0-SNAPSHOT-python.tgz +pip install target/systemml-1.0.0-SNAPSHOT-python.tar.gz ``` </div> <div data-lang="Python 3" markdown="1"> @@ -103,7 +103,7 @@ pip install target/systemml-1.0.0-SNAPSHOT-python.tgz git checkout https://github.com/apache/systemml.git cd systemml mvn clean package -P distribution -pip3 install target/systemml-1.0.0-SNAPSHOT-python.tgz +pip3 install target/systemml-1.0.0-SNAPSHOT-python.tar.gz ``` </div> </div> http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 2fb8a48..7e04af5 100644 --- a/pom.xml +++ b/pom.xml @@ -1149,8 +1149,8 @@ <configuration> <artifacts> <artifact> - <file>${basedir}/target/${project.artifactId}-${project.version}-python.tgz</file> - <type>tgz</type> + <file>${basedir}/target/${project.artifactId}-${project.version}-python.tar.gz</file> + <type>tar.gz</type> <classifier>python</classifier> </artifact> </artifacts> http://git-wip-us.apache.org/repos/asf/systemml/blob/2e6b577c/src/main/python/post_setup.py ---------------------------------------------------------------------- diff --git a/src/main/python/post_setup.py b/src/main/python/post_setup.py index d968d2d..7b53e44 100644 --- a/src/main/python/post_setup.py +++ b/src/main/python/post_setup.py @@ -38,4 +38,4 @@ src_path_prefix = os.path.join(root_dir, 'target', ARTIFACT_NAME + '-' + ARTIFAC src_path = src_path_prefix + '.zip' if platform.system() == "Windows" and os.path.exists(src_path_prefix + '.zip') else src_path_prefix + '.tar.gz' os.rename( src_path, - os.path.join(root_dir, 'target', ARTIFACT_NAME + '-' + ARTIFACT_VERSION + '-python.tgz')) + os.path.join(root_dir, 'target', ARTIFACT_NAME + '-' + ARTIFACT_VERSION + '-python.tar.gz'))