Giter Site home page Giter Site logo

alejandrogallo / python-doi Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 3.0 251 KB

Python library to work with Document Object Identifiers (doi)

License: Other

Makefile 52.43% Python 47.57%
doi python-3 publications scholar scihub zotero mendeley papis

python-doi's Introduction

python-doi

python-doi on the Python Package Index Travis Continuous Integration Coveralls Documentation Status GPL v3 License

Python package to work with Document Object Identifier (doi)

Development of python-doi happens on Github.

Installation

To install the latest released version of python-doi, run this command in your terminal:

$ pip install python-doi

This is the preferred method to install python-doi, as it will always install the most recent stable release.

If you don't have pip installed, this Python installation guide can guide you through the process.

To install the latest development version of python-doi from Github.

$ pip install git+https://github.com/alejandrogallo/python-doi.git@master#egg=doi

Usage

To use python-doi in a project:

import doi

python-doi's People

Contributors

alejandrogallo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

papis

python-doi's Issues

Add a network pytest mark for tests that use the network

  • python-doi version: 0.2
  • Python version: various
  • Operating System: openSUSE/Tumbleweed

Description

Sometimes it's useful to have the tests that use the network marked so they can be skipped easily when we know the network is not available.

This is useful for example on SUSE and openSUSE's build servers. When building our packages the network is disabled so we can assure reproducible builds (among other benefits). With this mark, it's easier to skip tests that can not succeed.

Proposed patch:

---
 setup.cfg         |    4 +++-
 tests/test_doi.py |    4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

--- a/setup.cfg
+++ b/setup.cfg
@@ -5,7 +5,9 @@ universal = 1
 exclude = docs
 
 [tool:pytest]
-collect_ignore = ['setup.py']
+markers =
+    net: marks tests that call use the net (using the URL endpoint, deselect with '-k "not net"')
+
 
 [mypy]
 disallow_redefinition = True
--- a/tests/test_doi.py
+++ b/tests/test_doi.py
@@ -3,6 +3,8 @@
 import os
 from pkg_resources import parse_version
 
+import pytest
+
 from doi import (
     validate_doi, find_doi_in_text, __version__, pdf_to_doi,
     get_real_url_from_doi
@@ -14,6 +16,7 @@ def test_valid_version() -> None:
     assert parse_version(__version__) >= parse_version("0.1.0")
 
 
+@pytest.mark.net
 def test_validate_doi() -> None:
     data = [
         ('10.1063/1.5081715',
@@ -38,6 +41,7 @@ def test_validate_doi() -> None:
             assert str(e) == 'HTTP 404: DOI not found'
 
 
+@pytest.mark.net
 def test_get_real_url_from_doi() -> None:
     data = [
         ('10.1016/S0009-2614(97)04014-1',

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.