Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mar10/wsgidav
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed Sep 30, 2022
2 parents e0d2691 + 721d85c commit 41b38ee
Show file tree
Hide file tree
Showing 22 changed files with 864 additions and 818 deletions.
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: mar10w # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ['https://www.paypal.com/donate/?hosted_button_id=RA6G29AZRUD44']
15 changes: 9 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ language: python

matrix:
include:
- python: "3.9"
env: TOXENV=check,lint
# env: TOXENV=check,lint,mypy
# - python: "3.9"
# env: TOXENV=check
- python: "3.10" # EOL 2026-10-04
env: TOXENV=py310
env: TOXENV=check,py310
dist: bionic
- python: "3.9" # EOL 2025-10-05
env: TOXENV=py39
- python: "3.8" # EOL 2024-10-14
env: TOXENV=py38
- python: "3.7" # EOL 2023-06-27
env: TOXENV=py37
dist: xenial
before_install:
# Fix "AttributeError: 'str' object has no attribute 'name'" on Py37
- pip install -U importlib_metadata
- python: "3.6" # EOL 2021-12-21
env: TOXENV=py36
# - python: "3.5" # EOL 2020-09-13
Expand All @@ -23,11 +26,11 @@ matrix:
# env: TOXENV=py34
- python: "3.11-dev"
env: TOXENV=py311
dist: bionic
allow_failures:
- python: "3.11-dev"
env: TOXENV=py311
# - python: "3.10" # Not supported by travis as of 2021-11-11
# env: TOXENV=py310
dist: bionic

before_install:
# See issue #80: litmus fails to build on travis
Expand Down
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Changelog

## 4.0.2 / Unreleased
## 4.0.3 / Unreleased

- #246 Add dir_browser/htdocs folder setup.cfg (for install with `pip install .`)

## 4.0.2 / 2022-08-01

- #251 Fix removing locks in recursive mode
- #245: Add charset utf-8 to Content-Type header
- #246 Add dir_browser/htdocs folder to sdist (.tar.gz)
- #248 Provider does not support set_last_modified" error
- #251 Fix removing locks in recursive mode
- #255 Fix ERROR: Invalid requirement: 'cheroot~=8'
- #260 Fix Case-Sensitivity issue on MOVE/COPY actions through Windows DAV
- Add shelve support to MSI installer (persistent lock- and property storage)
- Deprecate Python 3.6 (i.e. stop testing)

## 4.0.1 / 2022-01-11

Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi"

[dev-packages]
black = "~=22.1"
black = "~=22.6"
Cheroot = "*" # "~=8.5"
cx_Freeze = {version = "*", os_name = "== 'nt'"}
flake8 = "*" # "~=3.8"
Expand Down
1,432 changes: 702 additions & 730 deletions Pipfile.lock

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
[![Released with: Yabs](https://img.shields.io/badge/released%20with-yabs-yellowgreen)](https://github.com/mar10/yabs)
[![StackOverflow: WsgiDAV](https://img.shields.io/badge/StackOverflow-WsgiDAV-blue.svg)](https://stackoverflow.com/questions/tagged/WsgiDAV)

Experimental: [![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/mar10/wsgidav)

[![Open in Visual Studio Code](https://img.shields.io/badge/--007ACC?logo=visual%20studio%20code&logoColor=ffffff) Open in Visual Studio Code (experimental)](https://open.vscode.dev/mar10/wsgidav)

<!-- [![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/mar10/wsgidav) -->

A generic and extendable [WebDAV](http://www.ietf.org/rfc/rfc4918.txt) server
written in Python and based on [WSGI](http://www.python.org/dev/peps/pep-3333/).
Expand Down Expand Up @@ -68,7 +71,7 @@ See the ([change log](https://github.com/mar10/wsgidav/blob/master/CHANGELOG.md)
## More info

* [Read The Docs](http://wsgidav.rtfd.org) for details.
* [Discussion Group](https://groups.google.com/forum/#!forum/wsgidav)
* [Discussion Group](https://github.com/mar10/wsgidav/discussions)
* [Stackoverflow](http://stackoverflow.com/questions/tagged/wsgidav)


Expand Down
8 changes: 4 additions & 4 deletions docs/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ This small guideline may help taking the first steps.
Happy hacking :)

.. _`issue tracker`: https://github.com/mar10/wsgidav/issues
.. _forum: https://groups.google.com/forum/#!forum/wsgidav
.. _forum: https://github.com/mar10/wsgidav/discussions
.. _`the repository`: https://github.com/mar10/wsgidav
.. _`Stackoverflow`: http://stackoverflow.com/questions/tagged/wsgidav
.. _`Stackoverflow`: https://stackoverflow.com/questions/tagged/wsgidav
.. _CHANGES: https://github.com/mar10/wsgidav/blob/master/CHANGELOG.md


Expand Down Expand Up @@ -125,8 +125,8 @@ We need `Python 2.7 <https://www.python.org/downloads/>`_,
`Python 3.4+ <https://www.python.org/downloads/>`_,
and `pip <https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip>`_ on our system.

If you want to run tests on *all supported* platforms, install Python 2.7, 3.4,
3.5, and 3.6.
If you want to run tests on *all supported* platforms, install Python 3.7, 3.8,
3.9, and 3.10.

On Linux/OS X, we recommend to use `pipenv <https://github.com/kennethreitz/pipenv>`_
to activate a virtual environment::
Expand Down
5 changes: 4 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ Install WsgiDAV (and a server) like::

.. note::
MS Windows users that only need the command line interface may prefer the
`MSI installer <https://github.com/mar10/wsgidav/releases>`_.
`MSI installer <https://github.com/mar10/wsgidav/releases>`_ or install
using the Windows Package Manager::

> winget install wsgidav

To serve the ``/tmp`` folder as WebDAV ``/`` share with anonyoums read-write
access, simply run::
Expand Down
7 changes: 3 additions & 4 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ Install the preconditions if neccessary.
Basically the same as for `Linux / macOS`_

.. note::

MS Windows users that only need the command line interface may prefer to
download the `MSI installer <https://github.com/mar10/wsgidav/releases>`_. |br|
On modern Windows platforms it is even simpler::
MS Windows users that only need the command line interface may prefer the
`MSI installer <https://github.com/mar10/wsgidav/releases>`_ or install
using the Windows Package Manager::

> winget install wsgidav

Expand Down
5 changes: 4 additions & 1 deletion docs/source/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
defusedxml~=0.5
Jinja2~=2.10
json5~=0.8.5
python-pam~=1.8
python-pam~=2.0.2
PyYAML~=6.0
# RTD:
sphinx~=4.3
sphinx_rtd_theme~=1.0.0
readthedocs-sphinx-search==0.1.1
recommonmark~=0.7.1
# MyST
myst-parser[linkify]
sphinxcontrib-mermaid
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

-r requirements.txt

cheroot~=8 # 8.5
cheroot~=8.5
Paste~=2.0
# Black is beta and therefore requires --pre flag for installation unless we give the exact number
black~=22.1
Expand All @@ -21,3 +21,4 @@ tox~=3.13
twine~=1.11
WebTest~=2.0
wheel
yabs>=0.5
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defusedxml~=0.5
Jinja2~=2.10
json5~=0.8.5
python-pam~=1.8
python-pam~=2.0
PyYAML~=6.0
29 changes: 15 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
; universal = 1

[metadata]
name = WsgiDAV
# name = WsgiDAV # GitHub dependants needs it in setup.py?
version = attr: wsgidav.__version__
author = Martin Wendt
author_email = wsgidav@wwwendt.de
maintainer = Martin Wendt
maintainer_email = wsgidav@wwwendt.de
url = https://github.com/mar10/wsgidav/
url = https://github.com/mar10/wsgidav
project_urls =
Bug Tracker = https://github.com/mar10/wsgidav/issues
Source Code = https://github.com/mar10/wsgidav
Documentation = https://wsgidav.readthedocs.io/
Documentation = https://wsgidav.readthedocs.io
Download = https://github.com/mar10/wsgidav/releases/latest
Discussions = https://github.com/mar10/wsgidav/discussions

description = Generic and extendable WebDAV server based on WSGI
long_description = file: README.md
long_description_content_type = text/markdown
keywords = web, wsgi, webdav, application, server
license = MIT
license_file = LICENSE
license_files = LICENSE
classifiers =
# Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Expand All @@ -34,7 +35,7 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
; Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Expand Down Expand Up @@ -63,10 +64,6 @@ install_requires =
json5
PyYAML

# [options.package_data]
# * = *.txt, *.rst
# hello = *.msg

# [options.extras_require]
# pdf = ReportLab>=1.2; RXP
# rest = docutils>=0.3; pack ==1.1, ==1.3
Expand All @@ -77,13 +74,17 @@ include_package_data = True
exclude =
tests


[options.package_data]
# * =
# CHANGELOG.md
wsgidav =
dir_browser/htdocs/*.*


[options.data_files]
. = CHANGELOG.md
wsgidav/dir_browser = wsgidav/dir_browser/htdocs/*.*
# /etc/my_package =
# site.d/00_default.conf
# host.d/00_default.conf
# data = data/img/logo.png, data/svg/icon.svg


[options.entry_points]
console_scripts =
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
from setuptools import setup

setup(
name="WsgiDAV", # GitHub dependants needs it here?
# See setup.cfg
)
20 changes: 14 additions & 6 deletions setup_bdist_msi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python

# NOTE: isort must not chage this import order:
# isort: skip_file

import os
import re
import sys
Expand All @@ -19,13 +22,14 @@
org_version = __version__

# 'setup.py upload' fails on Vista, because .pypirc is searched on 'HOME' path
if "HOME" not in os.environ and "HOMEPATH" in os.environ:
os.environ.setdefault("HOME", os.environ.get("HOMEPATH", ""))
print("Initializing HOME environment variable to '{}'".format(os.environ["HOME"]))
# if "HOME" not in os.environ and "HOMEPATH" in os.environ:
# os.environ.setdefault("HOME", os.environ.get("HOMEPATH", ""))
# print("Initializing HOME environment variable to '{}'".format(os.environ["HOME"]))

# Since we included pywin32 extensions, cx_Freeze tries to create a
# version resource. This only supports the 'a.b.c[.d]' format.
# Our version has either the for '1.2.3' or '1.2.3-a1'
unsafe_version = False
major, minor, patch = org_version.split(".", 3)
major = int(major)
minor = int(minor)
Expand All @@ -46,7 +50,7 @@
# Remove leading letters
alpha = re.sub("^[a-zA-Z]+", "", alpha)
alpha = int(alpha)
if patch >= 1:
if unsafe_version and patch >= 1:
patch -= 1 # 1.2.3-a1 => 1.2.2.1
else:
# may be 1.2.0-a1 or 2.0.0-a1: we don't know what the previous release was
Expand All @@ -64,8 +68,11 @@
readme = "(readme not found. Running from tox/setup.py test?)"

# These dependencies are for plain WsgiDAV:
install_requires = [
]
# NOTE: Only need to list requirements that are not discoverable by scanning
# the main package. For example due to dynamic or optional imports.
# Also, cx_Freeze may have difficulties with packages listed here, e.g. PpyYAML:
# https://github.com/marcelotduarte/cx_Freeze/issues/1541
install_requires = []
# ... The Windows MSI Setup should include lxml and CherryPy
install_requires.extend(
[
Expand Down Expand Up @@ -96,6 +103,7 @@
"packages": [
"asyncio", # https://stackoverflow.com/a/41881598/19166
"cheroot",
"dbm",
"wsgidav.dir_browser",
"wsgidav.dc.nt_dc",
],
Expand Down
8 changes: 4 additions & 4 deletions tests/davclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,17 @@ def propfind(
property_stat = response.find("{DAV:}propstat")

def parse_props(props):
property_dict = {}
_property_dict = {}
for prop in props:
if prop.tag.find("{DAV:}") != -1:
name = prop.tag.split("}")[-1]
else:
name = prop.tag
if len(list(prop)):
property_dict[name] = parse_props(prop)
_property_dict[name] = parse_props(prop)
else:
property_dict[name] = prop.text
return property_dict
_property_dict[name] = prop.text
return _property_dict

if property_href is not None and property_stat is not None:
property_dict = parse_props(property_stat.find("{DAV:}prop"))
Expand Down

0 comments on commit 41b38ee

Please sign in to comment.