-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Final changes after moving the repository. Fix some parts of the CI, disable others. Add a script to prepare py2neo-archive distributions.
- Loading branch information
1 parent
7f57cbe
commit d222682
Showing
20 changed files
with
2,146 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
function prepend_readme { | ||
if [ -f README ] | ||
then | ||
readme_fn=README | ||
elif [ -f README.rst ]; then | ||
readme_fn=README.rst | ||
elif [ -f README.md ]; then | ||
readme_fn=README.md | ||
else | ||
echo "README not found!" 1>&2 | ||
exit 1 | ||
fi | ||
echo -n "This is a copy of the py2neo package to restore the version history that got deleted. | ||
It's not possible to re-upload a deleted version of a package to PyPI. | ||
So if you rely on, for example, \`py2neo ~= 4.1.0\` in your project, you can simply switch to \`py2neo-archive ~= 4.1.0\`. | ||
If your project works with py2neo 2021.2.3 or above, you can keep using \`py2neo\` as usual. | ||
Note that this project will not get any updates past version 2021.2.3. | ||
" | cat - $readme_fn > README.tmp && mv README.tmp $readme_fn | ||
} | ||
|
||
function check_install { | ||
python3.8 -m venv venv_vendor | ||
. venv_vendor/bin/activate | ||
pip install . | ||
deactivate | ||
rm -r venv_vendor | ||
} | ||
|
||
function vendor_packages { | ||
if grep -q -e 'interchange\|pansi' setup.py | ||
then | ||
python3.8 -m venv venv_vendor | ||
. venv_vendor/bin/activate | ||
pip install . | ||
for dep in interchange pansi | ||
do | ||
if path=$(python -c "import $dep; print($dep.__path__[0])") | ||
then | ||
if [ -d py2neo/vendor/$dep ] | ||
then | ||
rm -r py2neo/vendor/$dep | ||
fi | ||
dep_name_count=$(grep -r --include "*.py" $dep py2neo | wc -l) | ||
dep_import_count=$(grep -r --include "*.py" -E "from +$dep.* +import " py2neo | wc -l) | ||
if [ "$dep_name_count" -ne "$dep_import_count" ] | ||
then | ||
grep -r --include "*.py" $dep py2neo | ||
grep -r --include "*.py" -E "from +$dep.* +import " py2neo | ||
echo "dep_name_count = $dep_name_count != $dep_import_count = dep_import_count" 1>&2 | ||
exit 1 | ||
fi | ||
# vendor with relative imports | ||
# while IFS= read -r -d '' fn | ||
# do | ||
# depth=$(echo "$fn" | grep -o "/" | wc -l) | ||
# dots=$(for (( i = 0; i < "$depth"; ++i )); do echo -n "."; done) | ||
# sed -i "s/\(from \+\)$dep\(.*import \+\)/\1${dots}_${dep}\2/g" "$fn" | ||
# done < <(find py2neo -type f -name '*.py' -print0) | ||
# vendor with absolute imports | ||
find py2neo -type f -name '*.py' -print0 | xargs -0 sed -i "s/\(from \+\)$dep\(.*import \+\)/\1py2neo.vendor.$dep\2/g" | ||
grep -r --include "*.py" "$dep" py2neo | ||
echo "manually check this grep output!" | ||
sed -i "/\"$dep/d" setup.py | ||
mkdir -p py2neo/vendor | ||
touch py2neo/vendor/__init__.py | ||
cp -r $path py2neo/vendor/$dep | ||
fi | ||
done | ||
deactivate | ||
rm -r venv_vendor | ||
fi | ||
} | ||
|
||
# releases with version and package hard-coded py2neo/__init__.py | ||
for tag in release/1.6.2 release/1.6.3 py2neo-2.0 py2neo-2.0.1 py2neo-2.0.2 py2neo-2.0.3 py2neo-2.0.4 py2neo-2.0.5 py2neo-2.0.6 py2neo-2.0.7 py2neo-2.0.8 py2neo-2.0.9 py2neo-3.0.0 py2neo-3.1.0 py2neo-3.1.1 py2neo-3.1.2 | ||
do | ||
export PATCHED_VERSION=$tag | ||
git checkout $tag | ||
prepend_readme | ||
check_install | ||
sed -i "s/\"name\": .*,/\"name\": \"py2neo-archive\",/" setup.py | ||
sed -i "s/name=.*,/name=\"py2neo-archive\",/" setup.py | ||
python setup.py sdist | ||
git checkout -- . | ||
done | ||
|
||
# releases with version and package hard-coded py2neo/meta.py | ||
for tag in py2neo-4.0.0b1 py2neo-4.0.0b2 py2neo-4.0.0 py2neo-4.1.0 py2neo-4.1.1 py2neo-4.1.2 py2neo-4.1.3 py2neo-4.3.0 | ||
do | ||
export PATCHED_VERSION=$tag | ||
git checkout $tag | ||
prepend_readme | ||
check_install | ||
sed -i "s/\"name\": .*,/\"name\": \"py2neo-archive\",/" setup.py | ||
python setup.py sdist | ||
git checkout -- py2neo/meta.py | ||
git checkout -- . | ||
done | ||
|
||
# releases with dev version (ending in .dev0) and package hard-coded py2neo/__init__.py | ||
for tag in 5.0b2 5.0b3 5.0b4 5.0b5 2020.7b6 | ||
do | ||
export PATCHED_VERSION=$tag | ||
git checkout $tag | ||
prepend_readme | ||
check_install | ||
sed -i "s/\"name\": .*,/\"name\": \"py2neo-archive\",/" setup.py | ||
sed -i "s/__version__ = .*/__version__ = \"$tag\"/" py2neo/__init__.py | ||
python setup.py sdist | ||
git checkout -- . | ||
done | ||
|
||
# releases with dummy version loaded from VERSION file | ||
for tag in 2020.0b9 2020.0rc1 2020.0.0 2020.1a1 2020.1.0 2020.1.1 2020.7b7 2020.7b8 2021.0.0 2021.0.1 2021.1.0 2021.1.1 2021.1.2 2021.1.3 2021.1.4 2021.1.5 2021.2.0 2021.2.1 2021.2.2 2021.2.3 | ||
do | ||
export PATCHED_VERSION=$tag | ||
git checkout $tag | ||
prepend_readme | ||
vendor_packages | ||
sed -i "s/PACKAGE_NAME = .*/PACKAGE_NAME = \"py2neo-archive\"/" py2neo/meta.py | ||
echo -n $tag > py2neo/VERSION | ||
python setup.py sdist | ||
git checkout -- . | ||
done | ||
|
||
# now call | ||
#twine upload dist/py2neo-archive-*.tar.gz | ||
|
||
# clean-up for development | ||
#git checkout -- .; rm -r dist py2neo/interchange py2neo/_interchange py2neo/vendor/interchange py2neo/pansi py2neo/_pansi py2neo/vendor/pansi; rm -r venv_vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
. # py2neo | ||
./test/vendor/grolt | ||
|
||
coverage | ||
coveralls | ||
grolt>=1.0.6 | ||
pytest | ||
pytest-threadleak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[run] | ||
branch = True | ||
source = boltkit | ||
omit = | ||
**/__main__.py | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: | ||
|
||
ignore_errors = True | ||
show_missing = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*~ | ||
*.py[co] | ||
__pycache__ | ||
.pytest_cache | ||
.idea | ||
|
||
*.egg-info | ||
dist | ||
build | ||
|
||
neo4j-community-* | ||
neo4j-enterprise-* | ||
|
||
.coverage | ||
.tox |
Oops, something went wrong.