Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ad02f4e
Merge pull request #1 from nexB/add-initial-skeleton-files
steven-esser Oct 22, 2020
083bd04
Add azure pipeline config files and templates
JonoYang Oct 26, 2020
847564e
Fix path to Scripts directory
JonoYang Oct 27, 2020
0f293cb
Install current project in configure.bat
JonoYang Oct 27, 2020
63f6946
Call pytest from proper location
JonoYang Oct 27, 2020
7fd2506
Use newer VM images on Azure
JonoYang Oct 27, 2020
bceb8f9
Add .gitattributes
JonoYang Oct 29, 2020
e772fe6
Clean template
JonoYang Nov 4, 2020
ae44984
Merge pull request #11 from nexB/add-ci-config
JonoYang Nov 4, 2020
5593c2f
Merge pull request #14 from nexB/develop
JonoYang Nov 5, 2020
629abed
Update .gitignore to ignore Jupyter temp files
AyanSinhaMahapatra Nov 5, 2020
6001c74
Merge pull request #15 from nexB/jupyter-patch
pombredanne Nov 5, 2020
ef210cd
Quick doc update
steven-esser Nov 16, 2020
0b6caf9
Add RTD docs configuration file
AyanSinhaMahapatra Dec 10, 2020
f2c1400
Add basic RTD documentaion #4
AyanSinhaMahapatra Dec 10, 2020
e7d1990
Add RTD requirements file and test scripts
AyanSinhaMahapatra Dec 10, 2020
7d37af0
Add `src` folder to pass CI tests and RTD builds
AyanSinhaMahapatra Dec 16, 2020
b6ef568
Merge pull request #16 from AyanSinhaMahapatra/add-basic-docs
steven-esser Dec 21, 2020
03ffc8a
Ensure we use official full text of Apache 2.0
pombredanne Jan 6, 2021
98d4d69
Merge pull request #18 from nexB/apache-license
steven-esser Jan 6, 2021
5e386d9
Never ever let Git convert line delimiters
pombredanne Jan 14, 2021
2e48dca
Run tests on more OSes and Python versions
pombredanne Jan 14, 2021
b959539
Do not make wheel universal
pombredanne Jan 14, 2021
98641a0
Format and add license
pombredanne Jan 14, 2021
9fa3f31
Format
pombredanne Jan 14, 2021
0b8cd65
Improve documentation
pombredanne Jan 14, 2021
3007691
Format for spaces
pombredanne Jan 14, 2021
b49895c
Add manifest for source distributions
pombredanne Jan 14, 2021
d3e2d28
Add Apache license NOTICE
pombredanne Jan 14, 2021
6288928
Update license text and notice
pombredanne Jan 15, 2021
ae42157
Add correct authors
pombredanne Jan 15, 2021
74a7468
Populate changelog
pombredanne Jan 15, 2021
51ad1df
Ignore all Git auto CR/LF line endings conversions
pombredanne Jan 15, 2021
bd32341
Add manifest for sdist
pombredanne Jan 15, 2021
790e8d9
Merge branch update-boilerplate from skeleton
pombredanne Jan 15, 2021
6ef97c1
Add correct notice
pombredanne Jan 15, 2021
9f0e9d6
Improve README and command line notice
pombredanne Jan 15, 2021
e872181
Remove Python2 support
pombredanne Jan 15, 2021
bd36635
Update CHANGELOG
pombredanne Jan 15, 2021
31b3a43
Improve test expected failures
pombredanne Jan 15, 2021
fa46312
Format source code
pombredanne Jan 15, 2021
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore all Git auto CR/LF line endings conversions
* binary
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ pyvenv.cfg
/.pytest_cache/
lib64
tcl

# Ignore Jupyter Notebook related temp files
.ipynb_checkpoints/
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Where the Sphinx conf.py file is located
sphinx:
configuration: docs/source/conf.py

# Setting the python version and doc build requirements
python:
install:
- method: pip
path: .
extra_requirements:
- docs
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a skeleton Travis CI config file that provides a starting point for adding CI
# to a Python project. Since we primarily develop in python3, this skeleton config file
# will be specific to that language.
# will be specific to that language.
#
# See https://config.travis-ci.com/ for a full list of configuration options.

Expand Down
10 changes: 9 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
The following organizations or individuals have contributed to this repo:

-
- Abhishek Kumar @Abhishek-Dev09
- AlexB @a-tinsmith
- Maximilian Huber @maxhbr
- Michael Rupprecht @michaelrup
- Philippe Ombredanne @pombredanne
- Qingmin Duanmu @qduanmu
- Rakesh Balusa @balusarakesh
- Ravi Jain @JRavi2
- Steven Esser @majurg
21 changes: 19 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
Release notes
=============

vNext
-----

Version 21.1.15
-------------

*2021-01-15*
- Drop support for Python 2
- Use the latest CommonCode and TypeCode libraries

*2020-11-13*
- Add azure-pipelines CI support


Version 20.10
-------------
### Version 0.0.0

*xxxx-xx-xx* -- Initial release.
*2020-10-06*
- Initial release.
15 changes: 15 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
graft src

include *.LICENSE
include NOTICE
include *.ABOUT
include *.toml
include *.yml
include *.rst
include setup.*
include configure*
include requirements*
include .git*

global-exclude *.py[co] __pycache__ *.*~

19 changes: 19 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright (c) nexB Inc. and others.
# SPDX-License-Identifier: Apache-2.0
#
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
# ScanCode is a trademark of nexB 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.
#
39 changes: 37 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
extractcode
ExtractCode
===========
A set of functions and utilities used to extract archives.

- license: Apache-2.0
- copyright: copyright (c) nexB. Inc. and others
- homepage_url: https://github.com/nexB/extractode
- keywords: archiev, extraction, libarchive, 7zip, scancode-toolkit


ExtractCode is a universal archive extractor. It uses behind the scenes
the Python standard library, a custom ctypes binding to libarchive and
the 7zip command line to extract a large number of common and
less common archives and compressed files. It tries to extract things
in the same way on all OSes, including auto-renaming files that would
not have valid names on certain filesystems or when there are multiple
copies of the same path in a given archive.
The extraction is driven from a "voting" system that considers the
file extension(s) and name, the file type and mime type (using a ctypes
binding to libmagic) to select the most appropriate extractor or
uncompressor function. It can handle multi-level archives such as tar.gz.



Visit https://aboutcode.org and https://github.com/nexB/ for support and download.

To set up the development environment::

source configure

To run unit tests::

pytest -vvs -n 2

To clean up development environment::

./configure --clean


25 changes: 25 additions & 0 deletions apache-2.0.LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,28 @@
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

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.
64 changes: 64 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

################################################################################
# We use Azure to run the full tests suites on multiple Python 3.x
# on multiple Windows, macOS and Linux versions all on 64 bits
# These jobs are using VMs with Azure-provided Python builds
################################################################################

jobs:

- template: etc/ci/azure-linux.yml
parameters:
job_name: ubuntu16_cpython
image_name: ubuntu-16.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -vvs

- template: etc/ci/azure-linux.yml
parameters:
job_name: ubuntu18_cpython
image_name: ubuntu-18.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs

- template: etc/ci/azure-linux.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs

- template: etc/ci/azure-mac.yml
parameters:
job_name: macos1014_cpython
image_name: macos-10.14
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs

- template: etc/ci/azure-mac.yml
parameters:
job_name: macos1015_cpython
image_name: macos-10.15
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2016_cpython
image_name: vs2017-win2016
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp\Scripts\pytest -n 2 -vvs
3 changes: 2 additions & 1 deletion configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
#
# Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.
# Copyright (c) nexB Inc. and others.
# SPDX-License-Identifier: Apache-2.0
#

set -e
Expand Down
121 changes: 121 additions & 0 deletions configure.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
@echo OFF
@setlocal
@rem Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.

@rem ################################
@rem # A configuration script for Windows
@rem #
@rem # The options and (optional) arguments are:
@rem # --clean : this is exclusive of anything else and cleans the environment
@rem # from built and installed files
@rem #
@rem # --python < path to python.exe> : this must be the first argument and set
@rem # the path to the Python executable to use. If < path to python.exe> is
@rem # set to "path", then the executable will be the python.exe available
@rem # in the PATH.
@rem ################################

@rem Current directory where this .bat files lives
set CFG_ROOT_DIR=%~dp0
@rem path where a configured Python should live in the current virtualenv if installed
set CONFIGURED_PYTHON=%CFG_ROOT_DIR%tmp\Scripts\python.exe
set PYTHON_EXECUTABLE=


@rem parse command line options and arguments
:collectopts
if "%1" EQU "--help" (goto cli_help)
if "%1" EQU "--clean" (call rmdir /s /q "%CFG_ROOT_DIR%tmp") && call exit /b
if "%1" EQU "--python" (set PROVIDED_PYTHON=%~2) && shift && shift && goto collectopts

@rem If we have a pre-configured Python in our virtualenv, reuse this as-is and run
if exist ""%CONFIGURED_PYTHON%"" (
set PYTHON_EXECUTABLE=%CONFIGURED_PYTHON%
goto run
)

@rem If we have a command arg for Python use this as-is
if ""%PROVIDED_PYTHON%""==""path"" (
@rem use a bare python available in the PATH
set PYTHON_EXECUTABLE=python
goto run
)
if exist ""%PROVIDED_PYTHON%"" (
set PYTHON_EXECUTABLE=%PROVIDED_PYTHON%
goto run
)


@rem otherwise we search for a suitable Python interpreter
:find_python
@rem First check the existence of the "py" launcher (available in Python 3)
@rem if we have it, check if we have a py -3 installed with the good version or a py 2.7
@rem if not, check if we have an old py 2.7
@rem exist if all fails

where py >nul 2>nul
if %ERRORLEVEL% == 0 (
@rem we have a py launcher, check for the availability of our required Python 3 version
py -3.6 --version >nul 2>nul
if %ERRORLEVEL% == 0 (
set PYTHON_EXECUTABLE=py -3.6
) else (
@rem we have no required python 3, let's try python 2:
py -2 --version >nul 2>nul
if %ERRORLEVEL% == 0 (
set PYTHON_EXECUTABLE=py -2
) else (
@rem we have py and no python 3 and 2, exit
echo * Unable to find an installation of Python.
exit /b 1
)
)
) else (
@rem we have no py launcher, check for a default Python 2 installation
if not exist ""%DEFAULT_PYTHON2%"" (
echo * Unable to find an installation of Python.
exit /b 1
) else (
set PYTHON_EXECUTABLE=%DEFAULT_PYTHON2%
)
)


:run
@rem without this things may not always work on Windows 10, but this makes things slower
set PYTHONDONTWRITEBYTECODE=1

call mkdir "%CFG_ROOT_DIR%tmp"
call curl -o "%CFG_ROOT_DIR%tmp\virtualenv.pyz" https://bootstrap.pypa.io/virtualenv.pyz
call %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%tmp\virtualenv.pyz" "%CFG_ROOT_DIR%tmp"
call "%CFG_ROOT_DIR%tmp\Scripts\activate"
call "%CFG_ROOT_DIR%tmp\Scripts\pip" install --upgrade pip virtualenv setuptools wheel
call "%CFG_ROOT_DIR%tmp\Scripts\pip" install -e .[testing]

@rem Return a proper return code on failure
if %ERRORLEVEL% neq 0 (
exit /b %ERRORLEVEL%
)
endlocal
goto activate


:cli_help
echo A configuration script for Windows
echo usage: configure [options] [path/to/config/directory]
echo.
echo The options and arguments are:
echo --clean : this is exclusive of anything else and cleans the environment
echo from built and installed files
echo.
echo --python path/to/python.exe : this is set to the path of an alternative
echo Python executable to use. If path/to/python.exe is set to "path",
echo then the executable will be the python.exe available in the PATH.
echo.


:activate
@rem Activate the virtualenv
if exist "%CFG_ROOT_DIR%tmp\Scripts\activate" (
"%CFG_ROOT_DIR%tmp\Scripts\activate"
)
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading