initial import - empty project

This commit is contained in:
c056091 2020-03-09 18:12:38 -03:00
commit 99ca18774a
35 changed files with 998 additions and 0 deletions

28
.appveyor.yml Normal file
View File

@ -0,0 +1,28 @@
skip_tags: true
os: Visual Studio 2015
environment:
matrix:
- PYTHON: "C:\\Python36"
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37"
- PYTHON: "C:\\Python37-x64"
build_script:
- "git --no-pager log -n2"
- "echo %APPVEYOR_REPO_COMMIT%"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;;%PATH%"
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- "pip install ."
- "pip install -Ur test-requirements.txt"
- "pip install codecov"
test_script:
- "mkdir empty"
- "cd empty"
# Make sure it's being imported from where we expect
- "python -c \"import os, trio_ftplib; print(os.path.dirname(trio_ftplib.__file__))\""
- "python -u -m pytest -W error -ra -v -s --pyargs trio_ftplib --cov=trio_ftplib --cov-config=../.coveragerc"
- "codecov"

9
.coveragerc Normal file
View File

@ -0,0 +1,9 @@
[run]
branch=True
source=trio_ftplib
[report]
precision = 1
exclude_lines =
pragma: no cover
abc.abstractmethod

59
.gitignore vendored Normal file
View File

@ -0,0 +1,59 @@
# Add any project-specific files here:
# Sphinx docs
docs/build/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*~
\#*
.#*
# C extensions
*.so
# Distribution / packaging
.Python
/build/
/develop-eggs/
/dist/
/eggs/
/lib/
/lib64/
/parts/
/sdist/
/var/
/venv/
*.egg-info/
.installed.cfg
*.egg
# Installer logs
pip-log.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache
nosetests.xml
coverage.xml
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Rope
.ropeproject
# Django stuff:
*.log
*.pot

2
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# Default ignored files
/workspace.xml

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (trio-ftplib)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/trio-ftplib.iml" filepath="$PROJECT_DIR$/.idea/trio-ftplib.iml" />
</modules>
</component>
</project>

10
.idea/trio-ftplib.iml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

16
.readthedocs.yml Normal file
View File

@ -0,0 +1,16 @@
# https://docs.readthedocs.io/en/latest/yaml-config.html
formats:
- htmlzip
- epub
requirements_file: ci/rtd-requirements.txt
# Currently RTD's default image only has 3.5
# This gets us 3.6 (and hopefully 3.7 in the future)
# https://docs.readthedocs.io/en/latest/yaml-config.html#build-image
build:
image: latest
python:
version: 3
pip_install: True

33
.travis.yml Normal file
View File

@ -0,0 +1,33 @@
language: python
sudo: false
dist: trusty
matrix:
include:
# These are quick and often catch errors, so list them first
- python: 3.6
env: CHECK_DOCS=1
- python: 3.6
env: CHECK_FORMATTING=1
# Uncomment if you want to test on pypy nightly:
# - language: generic
# env: USE_PYPY_NIGHTLY=1
- python: 3.6
# As of 2018-07-05, Travis's 3.7 and 3.8 builds only work if you
# use dist: xenial AND sudo: required
# See: https://github.com/python-trio/trio/pull/556#issuecomment-402879391
- python: 3.7
dist: xenial
sudo: required
- python: 3.8-dev
dist: xenial
sudo: required
- os: osx
language: generic
env: MACPYTHON=3.6.6
- os: osx
language: generic
env: MACPYTHON=3.7.0
script:
- ci/travis.sh

82
CHEATSHEET.rst Normal file
View File

@ -0,0 +1,82 @@
Finishing setting up your project
=================================
Thanks for using cookiecutter-trio! This is your project now; you can
customize it however you like. Here's some reminders of things you
might want to do to get started:
* Check this into source control (``git init .; git add .; git
commit -m "Initial commit"``)
* Add a CODE_OF_CONDUCT.md
* Add a CONTRIBUTING.md
* Search the source tree for COOKIECUTTER-TRIO-TODO to find other
places to fill in.
* Enable `Read the Docs <https://readthedocs.org>`__. (Note: this
project contains a ``.readthedocs.yml`` file that should be enough
to get things working.)
* Set up continuous integration: Currently, this project is set up to
test on Linux and MacOS using Travis, on Windows using Appveyor, and
to test on PyPy.
If that's what you want, then go to Travis and Appveyor and enable
testing for your repo.
If that's not what you want, then you can trim the list by modifying
(or deleting) ``.travis.yml``, ``.appveyor.yml``, ``ci/travis.sh``.
* Enable `Codecov <https://codecov.io>`__ for your repo.
* File bugs or pull requests on `cookiecutter-trio
<https://github.com/python-trio/cookiecutter-trio>`__ reporting any
problems or awkwardness you ran into (no matter how small!)
* Delete this checklist once it's no longer useful
Tips
====
To run tests
------------
* Install requirements: ``pip install -r test-requirements.txt``
(possibly in a virtualenv)
* Actually run the tests: ``pytest trio_ftplib``
To run black
------------
* Show what changes black wants to make: ``black --diff setup.py
trio_ftplib``
* Apply all changes directly to the source tree: ``black setup.py
trio_ftplib``
To make a release
-----------------
* Update the version in ``trio_ftplib/_version.py``
* Run ``towncrier`` to collect your release notes.
* Review your release notes.
* Check everything in.
* Double-check it all works, docs build, etc.
* Build your sdist and wheel: ``python setup.py sdist bdist_wheel``
* Upload to PyPI: ``twine upload dist/*``
* Use ``git tag`` to tag your version.
* Don't forget to ``git push --tags``.

3
LICENSE Normal file
View File

@ -0,0 +1,3 @@
This software is made available under the terms of *either* of the
licenses found in LICENSE.APACHE2 or LICENSE.MIT. Contributions to are
made under the terms of *both* these licenses.

202
LICENSE.APACHE2 Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
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.

20
LICENSE.MIT Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

5
MANIFEST.in Normal file
View File

@ -0,0 +1,5 @@
include README.rst CHEATSHEET.rst LICENSE* CODE_OF_CONDUCT* CONTRIBUTING*
include .coveragerc
include test-requirements.txt
recursive-include docs *
prune docs/build

11
README.rst Normal file
View File

@ -0,0 +1,11 @@
Trio FTPLIB
===========
Welcome to `Trio FTPLIB <Project URL (for setup.py metadata)>`__!
Trionic async version of stdlib's ftplib
License: Your choice of MIT or Apache License 2.0
COOKIECUTTER-TRIO-TODO: finish filling in your README!
Must be valid ReST; also used as the PyPI description.

4
ci/rtd-requirements.txt Normal file
View File

@ -0,0 +1,4 @@
# RTD is currently installing 1.5.3, which has a bug in :lineno-match:
sphinx >= 1.6.1
sphinx_rtd_theme
sphinxcontrib-trio

93
ci/travis.sh Normal file
View File

@ -0,0 +1,93 @@
#!/bin/bash
set -ex
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
curl -Lo macpython.pkg https://www.python.org/ftp/python/${MACPYTHON}/python-${MACPYTHON}-macosx10.6.pkg
sudo installer -pkg macpython.pkg -target /
ls /Library/Frameworks/Python.framework/Versions/*/bin/
PYTHON_EXE=/Library/Frameworks/Python.framework/Versions/*/bin/python3
# The pip in older MacPython releases doesn't support a new enough TLS
curl https://bootstrap.pypa.io/get-pip.py | sudo $PYTHON_EXE
sudo $PYTHON_EXE -m pip install virtualenv
$PYTHON_EXE -m virtualenv testenv
source testenv/bin/activate
fi
if [ "$USE_PYPY_NIGHTLY" = "1" ]; then
curl -fLo pypy.tar.bz2 http://buildbot.pypy.org/nightly/py3.5/pypy-c-jit-latest-linux64.tar.bz2
if [ ! -s pypy.tar.bz2 ]; then
# We know:
# - curl succeeded (200 response code; -f means "exit with error if
# server returns 4xx or 5xx")
# - nonetheless, pypy.tar.bz2 does not exist, or contains no data
# This isn't going to work, and the failure is not informative of
# anything involving this package.
ls -l
echo "PyPy3 nightly build failed to download something is wrong on their end."
echo "Skipping testing against the nightly build for right now."
exit 0
fi
tar xaf pypy.tar.bz2
# something like "pypy-c-jit-89963-748aa3022295-linux64"
PYPY_DIR=$(echo pypy-c-jit-*)
PYTHON_EXE=$PYPY_DIR/bin/pypy3
($PYTHON_EXE -m ensurepip \
&& $PYTHON_EXE -m pip install virtualenv \
&& $PYTHON_EXE -m virtualenv testenv) \
|| (echo "pypy nightly is broken; skipping tests"; exit 0)
source testenv/bin/activate
fi
if [ "$USE_PYPY_RELEASE_VERSION" != "" ]; then
curl -fLo pypy.tar.bz2 https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3.5-${USE_PYPY_RELEASE_VERSION}-linux_x86_64-portable.tar.bz2
tar xaf pypy.tar.bz2
# something like "pypy3.5-5.7.1-beta-linux_x86_64-portable"
PYPY_DIR=$(echo pypy3.5-*)
PYTHON_EXE=$PYPY_DIR/bin/pypy3
$PYTHON_EXE -m ensurepip
$PYTHON_EXE -m pip install virtualenv
$PYTHON_EXE -m virtualenv testenv
source testenv/bin/activate
fi
pip install -U pip setuptools wheel
if [ "$CHECK_FORMATTING" = "1" ]; then
pip install black
if ! black --diff --check setup.py trio_ftplib; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Formatting problems were found (listed above). To fix them, run
pip install black
black setup.py trio_ftplib
in your local checkout.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
exit 1
fi
exit 0
fi
python setup.py sdist --formats=zip
pip install dist/*.zip
if [ "$CHECK_DOCS" = "1" ]; then
pip install -Ur ci/rtd-requirements.txt
cd docs
# -n (nit-picky): warn on missing references
# -W: turn warnings into errors
sphinx-build -nW -b html source build
else
# Actual tests
pip install -Ur test-requirements.txt
mkdir empty
cd empty
pytest -W error -ra -v --pyargs trio_ftplib --cov=trio_ftplib --cov-config=../.coveragerc --verbose
bash <(curl -s https://codecov.io/bash)
fi

20
docs/Makefile Normal file
View File

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = Trio FTPLIB
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)

36
docs/make.bat Normal file
View File

@ -0,0 +1,36 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=Trio FTPLIB
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd

View File

194
docs/source/conf.py Normal file
View File

@ -0,0 +1,194 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 21 19:11:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
# So autodoc can import our package
sys.path.insert(0, os.path.abspath('../..'))
# Warn about all references to unknown targets
nitpicky = True
# Except for these ones, which we expect to point to unknown targets:
nitpick_ignore = [
# Format is ("sphinx reference type", "string"), e.g.:
("py:obj", "bytes-like"),
]
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinxcontrib_trio',
]
intersphinx_mapping = {
"python": ('https://docs.python.org/3', None),
"trio": ('https://trio.readthedocs.io/en/stable', None),
}
autodoc_member_order = "bysource"
# Add any paths that contain templates here, relative to this directory.
templates_path = []
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Trio FTPLIB'
copyright = 'The Trio FTPLIB authors'
author = 'The Trio FTPLIB authors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
import trio_ftplib
version = trio_ftplib.__version__
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# The default language for :: blocks
highlight_language = 'python3'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'alabaster'
# We have to set this ourselves, not only because it's useful for local
# testing, but also because if we don't then RTD will throw away our
# html_theme_options.
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
# default is 2
# show deeper nesting in the RTD theme's sidebar TOC
# https://stackoverflow.com/questions/27669376/
# I'm not 100% sure this actually does anything with our current
# versions/settings...
"navigation_depth": 4,
"logo_only": True,
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'trio-ftplibdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'trio-ftplib.tex', 'Trio Documentation',
author, 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'trio-ftplib', 'Trio FTPLIB Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'trio-ftplib', 'Trio FTPLIB Documentation',
author, 'Trio FTPLIB', 'Trionic async version of stdlib's ftplib',
'Miscellaneous'),
]

6
docs/source/history.rst Normal file
View File

@ -0,0 +1,6 @@
Release history
===============
.. currentmodule:: trio_ftplib
.. towncrier release notes start

23
docs/source/index.rst Normal file
View File

@ -0,0 +1,23 @@
.. documentation master file, created by
sphinx-quickstart on Sat Jan 21 19:11:14 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
=====================================================
Trio FTPLIB: Trionic async version of stdlib's ftplib
=====================================================
.. toctree::
:maxdepth: 2
history.rst
====================
Indices and tables
====================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
* :ref:`glossary`

0
newsfragments/.gitkeep Normal file
View File

40
newsfragments/README.rst Normal file
View File

@ -0,0 +1,40 @@
Adding newsfragments
====================
This directory collects "newsfragments": short files that each contain
a snippet of ReST-formatted text that will be added to the next
release notes. This should be a description of aspects of the change
(if any) that are relevant to users. (This contrasts with your commit
message and PR description, which are a description of the change as
relevant to people working on the code itself.)
Each file should be named like ``<ISSUE>.<TYPE>.rst``, where
``<ISSUE>`` is an issue numbers, and ``<TYPE>`` is one of:
* ``feature``
* ``bugfix``
* ``doc``
* ``removal``
* ``misc``
So for example: ``123.feature.rst``, ``456.bugfix.rst``
If your PR fixes an issue, use that number here. If there is no issue,
then after you submit the PR and get the PR number you can add a
newsfragment using that instead.
Note that the ``towncrier`` tool will automatically
reflow your text, so don't try to do any fancy formatting. You can
install ``towncrier`` and then run ``towncrier --draft`` if you want
to get a preview of how your change will look in the final release
notes.
Making releases
===============
``pip install towncrier``, then run ``towncrier``. (You can use
``towncrier --draft`` to get a preview of what this will do.)
You can configure ``towncrier`` (for example: customizing the
different types of changes) by modifying ``pyproject.toml``.

7
pyproject.toml Normal file
View File

@ -0,0 +1,7 @@
[tool.towncrier]
package = "trio_ftplib"
filename = "docs/source/history.rst"
directory = "newsfragments"
underlines = ["-", "~", "^"]
# COOKIECUTTER-TRIO-TODO: fill in the URL below to point to your issue tracker:
issue_format = "`#{issue} <https://github.com/ACCOUNT/REPO/issues/{issue}>`__"

46
setup.py Normal file
View File

@ -0,0 +1,46 @@
from setuptools import setup, find_packages
exec(open("trio_ftplib/_version.py", encoding="utf-8").read())
LONG_DESC = open("README.rst", encoding="utf-8").read()
setup(
name="trio-ftplib",
version=__version__,
description="Trionic async version of stdlib's ftplib",
url="Project URL (for setup.py metadata)",
long_description=LONG_DESC,
author="Clovis Fabricio Costa",
author_email="python.nosklo@0sg.net",
license="MIT -or- Apache License 2.0",
packages=find_packages(),
install_requires=[
"trio",
],
keywords=[
# COOKIECUTTER-TRIO-TODO: add some keywords
# "async", "io", "networking", ...
],
python_requires=">=3.6",
classifiers=[
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Framework :: Trio",
# COOKIECUTTER-TRIO-TODO: Remove any of these classifiers that don't
# apply:
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
# COOKIECUTTER-TRIO-TODO: Consider adding trove classifiers for:
#
# - Development Status
# - Intended Audience
# - Topic
#
# For the full list of options, see:
# https://pypi.org/classifiers/
],
)

3
test-requirements.txt Normal file
View File

@ -0,0 +1,3 @@
pytest
pytest-cov
pytest-trio

3
trio_ftplib/__init__.py Normal file
View File

@ -0,0 +1,3 @@
"""Top-level package for Trio FTPLIB."""
from ._version import __version__

View File

View File

@ -0,0 +1 @@
from pytest_trio.enable_trio_mode import *

View File

@ -0,0 +1,15 @@
import trio
# We can just use 'async def test_*' to define async tests.
# This also uses a virtual clock fixture, so time passes quickly and
# predictably.
async def test_sleep_with_autojump_clock(autojump_clock):
assert trio.current_time() == 0
for i in range(10):
print("Sleeping {} seconds".format(i))
start_time = trio.current_time()
await trio.sleep(i)
end_time = trio.current_time()
assert end_time - start_time == i

3
trio_ftplib/_version.py Normal file
View File

@ -0,0 +1,3 @@
# This file is imported from __init__.py and exec'd from setup.py
__version__ = "0.0.0"