Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions 34 .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 1.3.{build}

environment:
matrix:
- python: 27
- python: 27-x64
- python: 35
- python: 35-x64
- python: 36
- python: 36-x64

install:
- SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%
- python -m pip.__main__ install -U pip wheel setuptools
- pip install -r requirements-test.txt

build: off
build_script:
# configure version
- ps: >-
If ($env:APPVEYOR_REPO_TAG -Eq "true" ) {
$version = "$env:APPVEYOR_REPO_TAG_NAME"
} Else {
$version = "$env:APPVEYOR_BUILD_VERSION.dev0"
}
$version | Set-Content version.txt
- python setup.py build bdist_wheel
- ps: Get-ChildItem dist\*.whl | % { pip install $_.FullName }

test: off
test_script:
- pip list
- py.test -v tests
- ps: Get-ChildItem dist\*.whl | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
1 change: 1 addition & 0 deletions 1 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.*
!.editorconfig
!.travis*
!.appveyor*
!.git*

# Python
Expand Down
2 changes: 1 addition & 1 deletion 2 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ addons:
- libxslt1-dev
- pkg-config
before_install:
- sed -i "s/1.0.1/${TRAVIS_TAG:-1.0.1}/" setup.py
- echo "${TRAVIS_TAG:-1.0.1.dev}" >version.txt
install:
- travis_retry pip install -r requirements-test.txt
- travis_retry pip install -e "."
Expand Down
4 changes: 3 additions & 1 deletion 4 MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include src/*
include requirements*.txt
include LICENSE

include version.txt
include setupinfo.py
include extra.py
78 changes: 52 additions & 26 deletions 78 README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ python-xmlsec

.. image:: https://travis-ci.org/mehcode/python-xmlsec.png?branch=master
:target: https://travis-ci.org/mehcode/python-xmlsec
.. image:: https://ci.appveyor.com/api/projects/status/20rtt2wv96gag9cy?svg=true
:target: https://ci.appveyor.com/project/bgaifullin/python-xmlsec
.. image:: https://img.shields.io/pypi/v/xmlsec.svg
:target: https://pypi.python.org/pypi/xmlsec
.. image:: https://img.shields.io/badge/docs-latest-green.svg
Expand Down Expand Up @@ -80,27 +82,52 @@ Mac
If you get any fatal errors about missing .h files, update your C_INCLUDE_PATH environment variable to
include the appropriate files from the libxml2 and libxmlsec1 libraries.


Windows (Wheel)
^^^^^^^^^^^^^^^

#. Download appropriate binary wheel from `ci.appveyor.com <https://ci.appveyor.com/project/bgaifullin/python-xmlsec>`_ (see build`s artifacts).

#. Install wheel

.. code-block:: bash

pip install <wheel filename>


Windows (pip)
^^^^^^^^^^^^^

#. Configure build environment, see `wiki.python.org <https://wiki.python.org/moin/WindowsCompilers>`_ for more details.

#. Install from pip

.. code-block:: bash

pip install xmlsec


Manual
------

1. Clone the **xmlsec** repository to your local computer.
#. Clone the **xmlsec** repository to your local computer.

.. code-block:: bash
.. code-block:: bash

git clone git://github.com/mehcode/python-xmlsec.git
git clone git://github.com/mehcode/python-xmlsec.git

2. Change into the **xmlsec** root directory.
#. Change into the **xmlsec** root directory.

.. code-block:: bash
.. code-block:: bash

cd /path/to/xmlsec
cd /path/to/xmlsec


3. Install the project and all its dependencies using `pip`.
#. Install the project and all its dependencies using `pip`.

.. code-block:: bash
.. code-block:: bash

pip install .
pip install .


************
Expand All @@ -110,44 +137,43 @@ Contributing
Setting up your environment
---------------------------

1. Follow steps 1 and 2 of the [manual installation instructions][].
#. Follow steps 1 and 2 of the `manual installation instructions <#manual>`_.

[manual installation instructions]: #manual

2. Initialize a virtual environment to develop in.
#. Initialize a virtual environment to develop in.
This is done so as to ensure every contributor is working with
close-to-identicial versions of packages.

.. code-block:: bash
.. code-block:: bash

mkvirtualenv xmlsec
mkvirtualenv xmlsec


The `mkvirtualenv` command is available from `virtualenvwrapper` which
can be installed by following: http://virtualenvwrapper.readthedocs.org/en/latest/install.html#basic-installation
The `mkvirtualenv` command is available from `virtualenvwrapper` which
can be installed by following `link <http://virtualenvwrapper.readthedocs.org/en/latest/install.html#basic-installation>`_

3. Install **xmlsec** in development mode with testing enabled.
#. Install **xmlsec** in development mode with testing enabled.
This will download all dependencies required for running the unit tests.

.. code-block:: bash
.. code-block:: bash

pip install -r requirements-test.txt
pip install -e "."
pip install -r requirements-test.txt
pip install -e "."


Running the test suite
----------------------

1. [Set up your environment](#setting-up-your-environment).
#. [Set up your environment](#setting-up-your-environment).

2. Run the unit tests.
#. Run the unit tests.

.. code-block:: bash
.. code-block:: bash

py.test tests
py.test tests

3. Tests configuration
Env variable **PYXMLSEC_TEST_ITERATIONS** specifies number of test iterations to detect memory leaks.
#. Tests configuration
Env variable **PYXMLSEC_TEST_ITERATIONS** specifies number of test iterations to detect memory leaks.

Reporting a issue
-----------------
Expand Down
25 changes: 25 additions & 0 deletions 25 doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,28 @@ Mac
brew install libxml2 libxmlsec1
pip install xmlsec



Windows (Wheel)
^^^^^^^^^^^^^^^

#. Download appropriate binary wheels from `appveyor <https://ci.appveyor.com/project/bgaifullin/python-xmlsec>`_ (see build`s artifacts).

#. Install downloaded wheel

.. code-block:: bash

pip install <downloaded wheel filename>


Windows (pip)
^^^^^^^^^^^^^

#. Configure build environment, see `wiki.python.org <https://wiki.python.org/moin/WindowsCompilers>`_ for more details.

#. Install from pip

.. code-block:: bash

pip install xmlsec

101 changes: 101 additions & 0 deletions 101 extra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import os
import sys

try:
from urlparse import urljoin
from urllib import urlretrieve, urlcleanup
except ImportError:
from urllib.parse import urljoin
from urllib.request import urlretrieve, urlcleanup


# use pre-built libraries on Windows
def get_prebuilt_libs(download_dir, static_include_dirs, static_library_dirs):
assert sys.platform.startswith('win')
libs = download_and_extract_windows_binaries(download_dir)
for ln, path in libs.items():
if ln == 'xmlsec1':
i = os.path.join(path, 'include', 'xmlsec1')
else:
i = os.path.join(path, 'include')

l = os.path.join(path, 'lib')
assert os.path.exists(i), 'does not exist: %s' % i
assert os.path.exists(l), 'does not exist: %s' % l
static_include_dirs.append(i)
static_library_dirs.append(l)


def download_and_extract_windows_binaries(destdir):
if sys.version_info < (3, 5):
if sys.maxsize > 2147483647:
url = "https://ci.appveyor.com/api/buildjobs/7q4nvmkdnu05dul6/artifacts/"
suffix = "vs2008.win64"
else:
url = "https://ci.appveyor.com/api/buildjobs/tdpx6rprr5431ec9/artifacts/"
suffix = "vs2008.win32"
else:
if sys.maxsize > 2147483647:
url = "https://ci.appveyor.com/api/buildjobs/hij3a6776pdv2007/artifacts/"
suffix = "win64"
else:
url = "https://ci.appveyor.com/api/buildjobs/7k878q7rvogcdyd9/artifacts/"
suffix = "win32"

libs = {
'libxml2': 'libxml2-2.9.4.{}.zip'.format(suffix),
'libxslt': 'libxslt-1.1.29.{}.zip'.format(suffix),
'zlib': 'zlib-1.2.8.{}.zip'.format(suffix),
'iconv': 'iconv-1.14.{}.zip'.format(suffix),
'openssl': 'openssl-1.0.1.{}.zip'.format(suffix),
'xmlsec': 'xmlsec-1.2.24.{}.zip'.format(suffix),
}

if not os.path.exists(destdir):
os.makedirs(destdir)

for ln, fn in libs.items():
srcfile = urljoin(url, fn)
destfile = os.path.join(destdir, fn)
if os.path.exists(destfile + ".keep"):
print('Using local copy of "{}"'.format(srcfile))
else:
print('Retrieving "%s" to "%s"' % (srcfile, destfile))
urlcleanup() # work around FTP bug 27973 in Py2.7.12+
urlretrieve(srcfile, destfile)

libs[ln] = unpack_zipfile(destfile, destdir)

return libs


def find_top_dir_of_zipfile(zipfile):
topdir = None
files = [f.filename for f in zipfile.filelist]
dirs = [d for d in files if d.endswith('/')]
if dirs:
dirs.sort(key=len)
topdir = dirs[0]
topdir = topdir[:topdir.index("/")+1]
for path in files:
if not path.startswith(topdir):
topdir = None
break
assert topdir, (
"cannot determine single top-level directory in zip file %s" %
zipfile.filename)
return topdir.rstrip('/')


def unpack_zipfile(zipfn, destdir):
assert zipfn.endswith('.zip')
import zipfile
print('Unpacking %s into %s' % (os.path.basename(zipfn), destdir))
f = zipfile.ZipFile(zipfn)
try:
extracted_dir = os.path.join(destdir, find_top_dir_of_zipfile(f))
f.extractall(path=destdir)
finally:
f.close()
assert os.path.exists(extracted_dir), 'missing: %s' % extracted_dir
return extracted_dir
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.