Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: emc-isilon/pike
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.3.15
Choose a base ref
...
head repository: emc-isilon/pike
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 4,453 additions and 649 deletions.
  1. +14 −0 .coveragerc
  2. +14 −0 .dockerignore
  3. +0 −31 .github/workflows/publishpackage.yml
  4. +38 −18 .github/workflows/test_samba.yml
  5. +61 −0 .github/workflows/wheels.yml
  6. +11 −1 .gitignore
  7. +2 −0 .gitignorerevs
  8. +1 −1 README.md
  9. +0 −32 build_all_wheels.sh
  10. +13 −0 buildwheel/Dockerfile
  11. +8 −0 buildwheel/README.md
  12. +22 −0 buildwheel/wheel27.sh
  13. +61 −0 doc/source/_templates/module.rst
  14. +24 −0 doc/source/autosummary.rst
  15. +296 −0 doc/source/conf.py
  16. +12 −0 doc/source/high_level.rst
  17. +142 −0 doc/source/index.rst
  18. +80 −0 doc/source/model.rst
  19. +9 −0 doc/source/open.rst
  20. +8 −0 doc/source/path.rst
  21. +28 −0 doc/source/pytest.rst
  22. +10 −0 doc/source/tree_connect.rst
  23. +47 −0 localsetup.py
  24. +0 −76 pike/pytest_support.py
  25. +19 −6 pykerb/kerberos.c
  26. +62 −39 pykerb/kerberos.py
  27. +34 −0 pykerb/vendor/py3c.h
  28. +141 −0 pykerb/vendor/py3c/capsulethunk.h
  29. +45 −0 pykerb/vendor/py3c/comparison.h
  30. +158 −0 pykerb/vendor/py3c/compat.h
  31. +50 −0 pykerb/vendor/py3c/fileshim.h
  32. +44 −0 pykerb/vendor/py3c/py3shims.h
  33. +52 −0 pykerb/vendor/py3c/tpflags.h
  34. +25 −1 pyproject.toml
  35. +2 −0 samba/.gitignore
  36. +5 −0 samba/Dockerfile
  37. +29 −0 samba/README.md
  38. +1 −0 samba/admin_password
  39. +9 −0 samba/build_and_test_wheels.sh
  40. +11 −0 samba/build_and_test_wheels27.sh
  41. +28 −0 samba/dc.sh
  42. +54 −0 samba/docker-compose.yml
  43. +22 −0 samba/krb5.conf.sh
  44. +16 −0 samba/run_all.sh
  45. +4 −0 samba/share.conf
  46. +53 −0 setup.cfg
  47. +7 −118 setup.py
  48. +8 −1 { → src}/pike/__init__.py
  49. 0 { → src}/pike/auth.py
  50. +26 −23 { → src}/pike/core.py
  51. +6 −3 { → src}/pike/crypto.py
  52. +18 −5 { → src}/pike/digest.py
  53. +72 −0 src/pike/exceptions.py
  54. +574 −0 src/pike/io.py
  55. +160 −229 { → src}/pike/model.py
  56. 0 { → src}/pike/netbios.py
  57. +12 −5 { → src}/pike/ntlm.py
  58. 0 { → src}/pike/ntstatus.py
  59. +2 −2 { → src}/pike/nttime.py
  60. +744 −0 src/pike/path.py
  61. +133 −0 src/pike/pytest_support.py
  62. +185 −13 { → src}/pike/smb2.py
  63. +94 −4 { → src}/pike/test/__init__.py
  64. 0 { → src}/pike/test/acl.py
  65. 0 { → src}/pike/test/appinstanceid.py
  66. 0 { → src}/pike/test/changenotify.py
  67. 0 { → src}/pike/test/compound.py
  68. +2 −2 { → src}/pike/test/copychunk.py
  69. +11 −11 { → src}/pike/test/credit.py
  70. 0 { → src}/pike/test/durable.py
  71. 0 { → src}/pike/test/echo.py
  72. 0 { → src}/pike/test/encryption.py
  73. +6 −3 { → src}/pike/test/invalid_session.py
  74. 0 { → src}/pike/test/invalid_tree.py
  75. 0 { → src}/pike/test/ioctl.py
  76. 0 { → src}/pike/test/lease.py
  77. 0 { → src}/pike/test/lock.py
  78. 0 { → src}/pike/test/multichannel.py
  79. 0 { → src}/pike/test/negotiate.py
  80. 0 { → src}/pike/test/oplock.py
  81. +1 −1 { → src}/pike/test/persistent.py
  82. 0 { → src}/pike/test/pytest.ini
  83. 0 { → src}/pike/test/query.py
  84. 0 { → src}/pike/test/querydirectory.py
  85. 0 { → src}/pike/test/queryondiskid.py
  86. 0 { → src}/pike/test/readwrite.py
  87. 0 { → src}/pike/test/reparse.py
  88. 0 { → src}/pike/test/session.py
  89. 0 { → src}/pike/test/set.py
  90. 0 { → src}/pike/test/tree.py
  91. +1 −0 { → src}/pike/transport.py
  92. 0 {pike/test/internal → tests}/__init__.py
  93. 0 {pike/test/internal → tests}/test_auth.py
  94. +29 −0 tests/test_basic_io.py
  95. +30 −2 {pike/test/internal → tests}/test_callbacks.py
  96. 0 {pike/test/internal → tests}/test_client.py
  97. +161 −0 tests/test_io.py
  98. +319 −0 tests/test_path.py
  99. 0 {pike/test → tests}/test_smb3_encryption_vector.py
  100. +22 −22 {pike/test/internal → tests}/test_write.py
  101. +65 −0 tox.ini
14 changes: 14 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[run]
parallel = true
concurrency = multiprocessing

[paths]
source =
pike/
*/site-packages/pike/

[report]
ignore_errors = True
omit =
tests/*
.tox/*
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
__pycache__
.coverage
.coverage.*
.idea
.pytest_cache
.tox

*.pyc
*.egg-info/

build
dist
doc/source/stubs
wheelhouse
31 changes: 0 additions & 31 deletions .github/workflows/publishpackage.yml

This file was deleted.

56 changes: 38 additions & 18 deletions .github/workflows/test_samba.yml
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@ on: [push, pull_request]
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
max-parallel: 5
matrix:
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, 3.10-dev]
python-version: ["3.6.15", 3.7, 3.8, 3.9, "3.10", "3.11"]

services:
samba:
@@ -24,30 +24,50 @@ jobs:
USER: pike;GiThubCI123
SHARE: pike;/share;;no;no;;pike;;
ports:
# will assign a random free host port
- 445/tcp
# will assign a random free host port
- 445/tcp

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
if: "!endsWith(matrix.python-version, '-dev')"
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: deadsnakes/action@v2.0.2
if: endsWith(matrix.python-version, '-dev')
with:
python-version: ${{ matrix.python-version }}
- run: python --version --version && which python
- name: Install Pike
run: python setup.py install
- name: Install pytest
run: pip install pytest
- run: python --version && which python
- name: Install dependencies
run: pip install tox tox-gh-actions
- name: Test Pike
env:
PIKE_SERVER: 127.0.0.1
PIKE_PORT: ${{ job.services.samba.ports[445] }}
PIKE_SHARE: pike
PIKE_CREDS: pike%GiThubCI123
run: tox -- -m 'not nosamba'

# python2.7 is no longer supported by actions/setup-python
build_legacy:

runs-on: ubuntu-20.04

services:
samba:
image: dperson/samba@sha256:2d94eb73e10402751afff19af10d3ad91014b137843bdd960bb39f4188acdcfa
env:
USER: pike;GiThubCI123
SHARE: pike;/share;;no;no;;pike;;
ports:
# will assign a random free host port
- 445/tcp

steps:
- uses: actions/checkout@v2
- name: "Install python2.7"
run: sudo apt-get update && sudo apt-get install python2.7 && curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
- name: Install dependencies
run: python2 -m pip install tox
- name: Test Pike
env:
PIKE_SERVER: 127.0.0.1
PIKE_PORT: ${{ job.services.samba.ports[445] }}
PIKE_SHARE: pike
PIKE_CREDS: pike%GiThubCI123
run: |
python -m unittest -v pike.test.samba_suite
python -m pytest --pyargs pike.test.internal
run: tox -e py27 -- -m 'not nosamba'
61 changes: 61 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Publish Wheels

on: [push, pull_request]

jobs:
build_wheels:
name: Build py3 wheels on ubuntu-22.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.11.3
- name: Build wheels
run: ./samba/dc.sh ./build_and_test_wheels.sh
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_wheels_py27:
name: Build py27 wheel on ubuntu-22.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install python2.7
- name: Build wheels
run: ./samba/dc.sh ./build_and_test_wheels27.sh
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_wheels_py27, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
__pycache__
.coverage
.coverage.*
.idea
.pytest_cache
.tox

*.pyc
*.egg-info/

build
dist
Pike.egg-info/
doc/source/stubs
wheelhouse
2 changes: 2 additions & 0 deletions .gitignorerevs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# blackify
03f70b27c00a188790c40a0a59e4cbfce29b9719
e347aeb25405a29e43492c125e532c969aa6d6c7
# move to /src
384b32c2436a974d8260b65c663567e669d5b2d5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ Optional: epydoc for doc generation

Ubuntu 14.04 / 16.04

apt-get install -y --no-install-recommends krb5-user libkrb5-dev python-dev build-essential python2.7 python-pip py3c-dev
apt-get install -y --no-install-recommends krb5-user libkrb5-dev python-dev build-essential python2.7 python-pip
pip install setuptools pycryptodomex
python setup.py install

32 changes: 0 additions & 32 deletions build_all_wheels.sh

This file was deleted.

13 changes: 13 additions & 0 deletions buildwheel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM quay.io/pypa/manylinux2010_x86_64
COPY . /src/pike
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && \
yum install -y krb5-devel krb5-workstation python27 && \
source /opt/rh/python27/enable && \
export PATH=$PATH:/opt/rh/python27/root/usr/bin && \
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rh/python27/root/usr/lib64 && \
echo /opt/rh/python27/root/usr/lib64 >> /etc/ld.so.conf && \
ldconfig && \
/opt/rh/python27/root/usr/bin/python2.7 -m pip install --trusted-host pypi.python.org -U 'pip<21' && \
/opt/rh/python27/root/usr/bin/python2.7 -m pip install --trusted-host pypi.python.org build
CMD /src/pike/buildwheel/wheel27.sh
8 changes: 8 additions & 0 deletions buildwheel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# buildwheel

build pike-smb2 manylinux wheel (including for python2.7)

```
docker build -t pike-buildwheel buildwheel
docker run -it -v /tmp/wheelhouse:/src/pike/wheelhouse pike-buildwheel
```
22 changes: 22 additions & 0 deletions buildwheel/wheel27.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# source before bash "strict mode"
source /opt/rh/python27/enable

set -euxo pipefail

# build py27 wheel
cd /src/pike
python2.7 -m build
auditwheel repair dist/*.whl

# Test the wheel
export PIKE_SERVER=$SAMBA_SERVER
export PIKE_SHARE=s1

./samba/krb5.conf.sh
python2.7 -m pip install wheelhouse/*-cp27*.whl
python2.7 -m unittest pike.test.session

# if the wheelhouse dir is mounted, copy tested wheels to host
[[ -d /wheelhouse ]] && cp wheelhouse/* /wheelhouse/
61 changes: 61 additions & 0 deletions doc/source/_templates/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}
:noindex:

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Module Attributes') }}

.. autosummary::
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
Loading