Giter Site home page Giter Site logo

dynofunc's People

Contributors

rayepps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dynofunc's Issues

Add support for boto `ValidationException` in error factory

Getting this error when passing bad query arguments:

try:
            return runner(client, description)
        except ClientError as err:
>           raise factory(err)
E           dynamof.core.exceptions.UnknownDatabaseException: An unkonwn exception occured when executing request to dynamo: Query condition missed key schema element - ValidationException

Need to add a ValidationException in the factory so it can get caught and handled.

Installing dynamof does not install dependencies

The Problem

When installing dynamof in a fresh virtual environment with no other dependencies yet installed it errors out saying boto3 is not installed. The expectation is that pip can see that dynamof depends on boto3 and installs it as a dependency before it tries to install dynamof.

Workaround

Install the dependencies (only one is boto3) manually before installing dynamof. Run pip install boto3 then install dynamof.

Steps to reproduce

  1. Create a fresh virtual environment: python3 -m venv venv
  2. Activate the venv: source venv/bin/activate
  3. Install dynamof with pip: pip install dynamof==2.1.7

The result is:

(venv) @rayepps ~/projects zsh $ pip install dynamof==2.1.6
Collecting dynamof==2.1.6
  Using cached https://files.pythonhosted.org/packages/5b/6c/2a3237411d0c5cefbf4307a26a9d80d5908b663349ae612ed1747da16146/dynamof-2.1.6.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/fz/lxvknht5231glfllq3hrwhth0000gn/T/pip-build-i5xz1mpd/dynamof/setup.py", line 3, in <module>
        from dynamof.version import VERSION
      File "/private/var/folders/fz/lxvknht5231glfllq3hrwhth0000gn/T/pip-build-i5xz1mpd/dynamof/dynamof/__init__.py", line 5, in <module>
        from dynamof.operations.add import add
      File "/private/var/folders/fz/lxvknht5231glfllq3hrwhth0000gn/T/pip-build-i5xz1mpd/dynamof/dynamof/operations/add.py", line 2, in <module>
        from dynamof.core import builder as ab
      File "/private/var/folders/fz/lxvknht5231glfllq3hrwhth0000gn/T/pip-build-i5xz1mpd/dynamof/dynamof/core/builder.py", line 1, in <module>
        from boto3.dynamodb.types import TypeSerializer
    ModuleNotFoundError: No module named 'boto3'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/fz/lxvknht5231glfllq3hrwhth0000gn/T/pip-build-i5xz1mpd/dynamof/
You are using pip version 9.0.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Simplify + improve the docs

Our docs are many... so much so I think they're unhelpful. Let's simplify. Possibly remove the api documentation... I don't think it's helpful. When introducing new users to dynamof we should start with an example where we only use an operation function (like query) to build the boto3 description. Show them the result of that call and what it does, describe that this is the core function of dynamof. Then we can show them the use of the execute and the extra layer it adds.

Can't install with pip : No matching distribution found for dynofunc

Hi, i just try to install your lib but I have some errors. It seem's that it complain about my python version that doesn't meet the requirement of python >= 3 but I'm using python 3.9, any idea ?

Also you have a warning with the readme

user@MacBook-Pro:~/Documents/⚡ ⇒  pip3 -vvv install dynofunc                
Using pip 21.0.1 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-ephem-wheel-cache-be37nipu
Created temporary directory: /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-req-tracker-r44tjnxh
Initialized build tracking at /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-req-tracker-r44tjnxh
Created build tracker: /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-req-tracker-r44tjnxh
Entered build tracker: /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-req-tracker-r44tjnxh
Created temporary directory: /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-install-c_p390fk
1 location(s) to search for versions of dynofunc:
* https://pypi.org/simple/dynofunc/
Fetching project page and analyzing links: https://pypi.org/simple/dynofunc/
Getting page https://pypi.org/simple/dynofunc/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/dynofunc/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/dynofunc/ HTTP/1.1" 304 0
  Found link https://files.pythonhosted.org/packages/58/28/ac1637a50967d3067780cfdcf922e32e2faf24267df0b638358720df5d1e/dynofunc-1.0.0.tar.gz#sha256=35e37ef8e37bebcd7ee07a4b88c2b7cf9e5fb7f3eb9d96db30aa725b5fff4de6 (from https://pypi.org/simple/dynofunc/) (requires-python:>=3), version: 1.0.0
Given no hashes to check 1 links for project 'dynofunc': discarding no candidates
Collecting dynofunc
  Created temporary directory: /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-unpack-j7pq2hoc
  Looking up "https://files.pythonhosted.org/packages/58/28/ac1637a50967d3067780cfdcf922e32e2faf24267df0b638358720df5d1e/dynofunc-1.0.0.tar.gz" in the cache
  Current age based on date: 8621
  Ignoring unknown cache-control directive: immutable
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 8621
  Using cached dynofunc-1.0.0.tar.gz (14 kB)
  Added dynofunc from https://files.pythonhosted.org/packages/58/28/ac1637a50967d3067780cfdcf922e32e2faf24267df0b638358720df5d1e/dynofunc-1.0.0.tar.gz#sha256=35e37ef8e37bebcd7ee07a4b88c2b7cf9e5fb7f3eb9d96db30aa725b5fff4de6 to build tracker '/private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-req-tracker-r44tjnxh'
    Running setup.py (path:/private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-install-c_p390fk/dynofunc_c3eaa9e701f442e08560cbb39efec22a/setup.py) egg_info for package dynofunc
    Created temporary directory: /private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-pip-egg-info-ax3k1sko
    Running command python setup.py egg_info
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-install-c_p390fk/dynofunc_c3eaa9e701f442e08560cbb39efec22a/setup.py", line 5, in <module>
        with open('README.md', 'r') as fh:
    FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
WARNING: Discarding https://files.pythonhosted.org/packages/58/28/ac1637a50967d3067780cfdcf922e32e2faf24267df0b638358720df5d1e/dynofunc-1.0.0.tar.gz#sha256=35e37ef8e37bebcd7ee07a4b88c2b7cf9e5fb7f3eb9d96db30aa725b5fff4de6 (from https://pypi.org/simple/dynofunc/) (requires-python:>=3). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement dynofunc
ERROR: No matching distribution found for dynofunc
Exception information:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
    crit = self.state.criteria[name]
KeyError: 'dynofunc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 318, in resolve
    name, crit = self._merge_into_criterion(r, parent=None)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _merge_into_criterion
    crit = Criterion.from_requirement(self._p, requirement, parent)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 83, in from_requirement
    raise RequirementsConflicted(criterion)
pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('dynofunc')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
    self._result = resolver.resolve(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 453, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 320, in resolve
    raise ResolutionImpossible(e.criterion.information)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('dynofunc'), parent=None)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
    return func(self, options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 316, in run
    requirement_set = resolver.resolve(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 127, in resolve
    six.raise_from(error, e)
  File "<string>", line 3, in raise_from
pip._internal.exceptions.DistributionNotFound: No matching distribution found for dynofunc
Removed dynofunc from https://files.pythonhosted.org/packages/58/28/ac1637a50967d3067780cfdcf922e32e2faf24267df0b638358720df5d1e/dynofunc-1.0.0.tar.gz#sha256=35e37ef8e37bebcd7ee07a4b88c2b7cf9e5fb7f3eb9d96db30aa725b5fff4de6 from build tracker '/private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-req-tracker-r44tjnxh'
Removed build tracker: '/private/var/folders/93/5gnyqj597qqg9dnrb1nx2jym0000gn/T/pip-req-tracker-r44tjnxh'
user@MacBook-Pro:~/Documents/⚡ ⇒   

Automate deployments to PyPi

When a PR is merged to develop we should automatically build the distribution package and upload it to PyPi. This will require that first we build some PR automation that requires that the version is bumped before a PR can be merged. If we don't, errors will occur when the automation attempts to publish a package with the same version as one that already exists.

  • Automation in place requiring PRs to include a version bump
  • On merging into develop a new distribution is created and uploaded to PyPi

Need a FilterExpression for query operation

Boto3 supports a filter expression on the query operation. We need to implement this. Should be easy, docs here say

The syntax for a filter expression is identical to that of a condition expression. Filter expressions can use the same comparators, functions, and logical operators as a condition expression.

Need to setup better logging system so users can control logs with level

Currently the only logging is some print statement (sorry - I'm only one man). Let's build a logging module and start using it to print logs anywhere there is useful information.

We might be able to avoid creating a separate logging module since its gonna be so slim. We really just need to make sure we're using a consistent logger name for now.

All logs should be a debug level. I don't think we're doing any work in dynamof (asside from errors) that merits other levels of logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.