Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update to latest uap-core #54

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

Closed
asalant opened this issue Feb 3, 2017 · 10 comments
Closed

Update to latest uap-core #54

asalant opened this issue Feb 3, 2017 · 10 comments

Comments

@asalant
Copy link

asalant commented Feb 3, 2017

@mattrobenolt - unfortunately I missed an issue in uap-core that left my fix for Pingdom bot detection incomplete. #53 includes that fix. I'd appreciate another patch release of uap-python.

Thanks!

@asalant
Copy link
Author

asalant commented Feb 9, 2017

@mattrobenolt another ping up this release request. 🙏

@mattrobenolt
Copy link
Member

sigh part of the way this project works is it's possible for you to link to whatever files you want as a source of rules. A bump here isn't a requirement. You can set the UA_PARSER_YAML environment variable and point it to whatever file you want.

https://github.com/ua-parser/uap-python/blob/master/ua_parser/user_agent_parser.py#L449-L450

There is a reason why this isn't 100% in sync all the time and I don't bump versions on every single commit upstream.

@asalant
Copy link
Author

asalant commented Feb 9, 2017

Ah, that's super helpful. Would be a good addition to the README to help reduce nagging from folks like me.

I'm fine with going that route for now. It does leave the "fix" that I contributed in a halfway complete state but it will get resolved the next time you sync with aup-core.

@meagerman
Copy link

The regexes from uap-core have not been updated in this project in over a year. If the authors seriously don't consider updated regexes to be a core mandate of this project then please change the project so that it does not ship with a built-in regex file, but forces the client to provide one, and change the docs to reflect this.

I also think the choice of an environment variable is a bit obscure. Providing a setup method on the module would make it more obvious and more flexible to configure.

@mattrobenolt
Copy link
Member

So here's the current dilemma updating to latest master ua-parser/uap-core@8783129

....F.....
======================================================================
FAIL: testBrowserscopeStringsOS (__main__.ParseTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "ua_parser/user_agent_parser_test.py", line 48, in testBrowserscopeStringsOS
    TEST_RESOURCES_DIR, 'tests/test_os.yaml'))
  File "ua_parser/user_agent_parser_test.py", line 191, in runOSTestsFromYAML
    result['patch_minor']))
AssertionError: UA: Mozilla/5.0 (Windows U; Win NT 5.0; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
 expected<Windows NT None None None> != actual<Windows $1 None None None>

----------------------------------------------------------------------
Ran 10 tests in 44.042s

FAILED (failures=1)

So will need to investigate why this test now fails. :(

@meagerman
Copy link

I found a relatively painless way to integrate the latest yaml into my build. I just downloaded the rules and committed it in a static directory that gets deployed with my project, and referenced it using a relative path like this before importing ua_parser:

os.environ['UA_PARSER_YAML'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', 'user_agents.yaml')

Works well enough.

@panther7
Copy link

panther7 commented Mar 9, 2018

Hello, please update to latest (June 2017 or newer). Thanks.

@ondras
Copy link
Contributor

ondras commented Mar 23, 2018

@mattrobenolt please, what is the status with this? We are currently unable to use uap-python from pip due to old regex definitions...

@ondras
Copy link
Contributor

ondras commented Mar 26, 2018

The fix is ready to be merged in #59 .

@mattrobenolt
Copy link
Member

Fixed by 0.8.0 https://pypi.org/project/ua-parser/0.8.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants