Skip to main content

No project description provided

Project description

poetry

  • step 1: install poetry using

    curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

    before using the above code in Ubuntu system, you must set the default python to the version you want. Because by default python is set to version 2.7 in Ubuntu.

  • step 2: Create a new project

    poetry new [project-name]

    The output will create a structured project. It will create a ‘pyproect.toml’ file also . This ‘.toml’ file will have all the configuration for project.

  • step 3: Some useful cli commands for poetry

    # add packages to project
        poetry add numpy, pandas
    
    # checking
        poetry check
    
    # build the package
        poetry build
    
    # publish to pypi
        poetry publish
    
    # venv of poetry
        poetry shell

Poetry + Vscode

  • step 1: open the project with vscode.

  • step 2: Set the environment:

    # add the poetry venv directory path to vscode setting
        "python.venvPath": "~/.cache/pypoetry/virtualenvs"
    
    # now add the python path from down below bar of vscode
    # to project env.
  • step 3: Set the testing in vscode:

    # open command palette
        'ctrl' + 'shift' + 'p'
    
    # search for 'test' in command palette
    
    # choose the python test from drop down
    
    # Then select pytest from drop down
    
    # In the down below of vscode a lightning
    # 'Run test' will appear
    
    # In the left side of vscode a chemistry
    # lab flask will appear for testing your tests.

Poetry + Sphinx

  • step 1: Add the package in development mode

    poetry add -D sphinx
  • step 2: Create a new doc directory and inside it run sphinx-quickstart. Then fill out all the things it asks, incase of not knowing just press enter, it will take the default setting.

  • step 3: The ‘docs’ folder now will contain _build, conf.py and index.rst. We need to edit them.

  • step 4: Open conf.py

    # Uncomment them
    
        import os
        import sys
    
        sys.path.insert(0, os.path.abspath(".."))
    
    # Add sphinx packages and theme
    
        extensions = ["sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx.ext.autodoc"]
    
        # html_theme = "alabaster"
          html_theme = "nature"
  • step 5: Use make html command for building html pages.

  • step 6: open the html from docs/_build/html/index.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dina-test-0.1.2.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

dina_test-0.1.2-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page