Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix package namespacing #7

Closed
wants to merge 4 commits into from
Closed
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
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ python:
- 'pypy'
- 'pypy3.5'
env:
global:
- DROPBOX_ACCESS_TOKEN=GiQj7BV19aAAAAAAAAAACAevudx3Rxyca3vKenwRV9suPJ2sWKw3Bm6rC9CpxDM2

- PYTHONPATH=.

install:
- pip install -U pip setuptools wheel pytest-rerunfailures pytest
- pip install .
- pip install -e .

script:
- pytest -v --reruns 5 dropboxfs/tests/test_dropboxfs.py
- pytest -v --reruns 5 tests

after_success:
- coveralls
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Release History
===============

0.3.0
-----

**Breaking**:

Moved ``dropboxfs`` module inside ``fs`` to be consistent with its namespacing.
Fixes `#6 <https://github.com/PyFilesystem/fs.dropboxfs/issues/6>`_. Imports must
now be from `fs.dropboxfs` instead of `dropboxfs`.

0.2.2-post1
-----------

Expand Down
Empty file removed dropboxfs/tests/__init__.py
Empty file.
14 changes: 0 additions & 14 deletions dropboxfs/tests/testone.py

This file was deleted.

1 change: 1 addition & 0 deletions fs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
2 changes: 2 additions & 0 deletions fs/dropboxfs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .dropboxfs import DropboxFile
from .dropboxfs import DropboxFS
9 changes: 3 additions & 6 deletions dropboxfs/dropboxfs.py → fs/dropboxfs/dropboxfs.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import logging
import threading
from contextlib import closing, contextmanager
from contextlib import closing
from datetime import datetime
from io import BytesIO

import dropbox
import six
from dropbox import Dropbox
from dropbox.exceptions import ApiError
from dropbox.files import (DownloadError, FileMetadata, FolderMetadata,
LookupError, WriteMode)
from dropbox.files import (FileMetadata, FolderMetadata, LookupError, WriteMode)
from fs import errors
from fs.base import FS
from fs.enums import ResourceType, Seek
from fs.enums import ResourceType
from fs.info import Info
from fs.mode import Mode
from fs.subfs import SubFS
from fs.time import datetime_to_epoch, epoch_to_datetime

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
Expand Down
3 changes: 1 addition & 2 deletions dropboxfs/opener.py → fs/dropboxfs/opener.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
class DropboxOpener(Opener):
protocols = ["dropbox"]

@staticmethod
def open_fs(fs_url, parse_result, writeable, create, cwd):
def open_fs(self, fs_url, parse_result, writeable, create, cwd):
from .dropboxfs import DropboxFS

_, _, directory = parse_result.resource.partition("/")
Expand Down
12 changes: 5 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ description = Dropbox support for pyfilesystem2
license = MIT
long_description = file: README.rst, HISTORY.rst
name = fs.dropboxfs
packages = find:
platforms = any
url = http://pypi.python.org/pypi/fs.dropboxfs/
version = 0.2.2-post1
version = 0.3.0

[options]
install_requires =
dropbox>=8.0, <10
fs>=2.0.26,<2.5
six>=1.9
python_requires = >=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
namespace_packages = fs
packages = fs.dropboxfs
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
tests_require =
pytest==4.3.1
pytest-randomly==1.2.3 ; python_version<="3.4"
Expand All @@ -41,7 +42,4 @@ tests_require =

[options.entry_points]
fs.opener =
dropbox = dropboxfs.opener:DropboxOpener

[options.packages.find]
exclude = tests
dropbox = fs.dropboxfs.opener:DropboxOpener
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python

from setuptools import setup, find_packages
from setuptools import setup

setup(test_suite='dropboxfs.tests')
setup(test_suite='fs.dropboxfs.tests')
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dropbox import create_session
from fs.test import FSTestCases

from dropboxfs.dropboxfs import DropboxFS
from fs.dropboxfs import DropboxFS


def join(a, b):
Expand Down