Giter VIP home page Giter VIP logo

cookiecutter-caproto-ioc's Introduction

caproto IOC Cookiecutter

Requirements for the Template

  • Python >= 3.10
  • Cookiecutter Python package >= 1.4.0: This can be installed with pip by or conda depending on how you manage your Python packages:
$ pip install cookiecutter

Starting a New Project

$ cookiecutter https://github.com/spc-group/cookiecutter-caproto-ioc

Zero to IOC

# Use the cookiecutter
$ cookiecutter https://github.com/spc-group/cookiecutter-caproto-ioc
project_name [project_name]:
gitlab_repo_group [25ID]:
repo_name [project_name]:
default_prefix [SIM:]:
author_name [SLAC National Accelerator Laboratory]:
email []:
folder_name [project_name]:
import_name [project_name]:
description [project_name]:
Select license:
1 - SLAC
2 - BNL
3 - MIT
4 - BSD-3
Choose from 1, 2, 3, 4 [1]:
Select auto_gitlab_setup:
1 - no
2 - yes
Choose from 1, 2 [1]:
git_remote_name [origin]:
Select auto_doctr_setup:
1 - no
2 - yes
Choose from 1, 2 [1]:
Select use_x11_on_travis:
1 - no
2 - yes
Choose from 1, 2 [1]:
year [2020]:

# Create a test environment
$ conda create -n my_test_env python=3.7
$ conda activate my_test_env

# Install the project in that environment
$ cd project_name
$ pip install .

# Run the IOC
$ project_name --list-pvs
[I 17:33:28.970       server:  133] Asyncio server starting up...
[I 17:33:28.971       server:  146] Listening on 0.0.0.0:5064
[I 17:33:28.972       server:  205] Server startup complete.
[I 17:33:28.973       server:  207] PVs available:
    SIM:SampleValue
    SIM:SampleScanned
This happens at IOC boot!
Initial value was: 0.0
Now it is: 0.1

^C
[I 17:33:30.442       server:  212] Server task cancelled. Will shut down.
[I 17:33:30.442       server:  222] Server exiting....

# Alternatively:
$ python -m project_name --list-pvs

# Build the docs:
$ cd docs
$ make html

# Open them in your browser:
# (macOS)
$ open build/html/index.html
# (Linux)
$ xdg-open build/html/index.html

Manually Configuring a New Project

To manually setup versioneer, activate an environment with versioneer installed and run the following command and commit the new files it makes.

$ versioneer install

Doctr pushes automatically generated docs from travis to a github pages site. To manually begin using doctr first enable the use_doctr setting during cookiecutter setup and push the newly created repository to github. In the settings page on the github repository, make sure to enable pages on the gh-pages branch. Make sure travis has recognized and been set to process your new repository. Once setup has completed, activate an environment with doctr installed and run this command.

$ doctr configure

After entering your information, add the secure key to env/global/secure in the .travis.yml file. In the settings page on the github repository, make sure to enable pages on the gh-pages branch. Note: Branch protection should be enabled for all branches in the repository hosting the documentation as the key could potentially allow others to push to this repository.

Installing Development Requirements

$ pip install -Ur requirements.txt
$ pip install -Ur dev-requirements.txt

Cookiecutter?

To learn more about cookiecutter:

cookiecutter-caproto-ioc's People

Contributors

klauer avatar canismarko avatar

Forkers

canismarko

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.