<jupyter_start><jupyter_text>In order to successfully complete this assignment you must do the required reading, watch the provided videos and complete all instructions.  The embedded Google form must be entirely filled out and submitted on or before **11:59pm on Sunday April 12**.  Students must come to class the next day prepared to discuss the material covered in this assignment. answer  Pre-Class Assignment: Sharing Your Code with the WorldThis pre-class will discuss how to turn your project into something installable.  The two major installation platforms in Python are PyPi (PIP) and Conda.  This is not required for the class but some of you are thinking of submitting your projects to JOSS and/or sharing with people outside your labs. In both cases you should consider registering your project with pypi and Conda.  Goals for today's pre-class assignment 1. [PyPi installer](PyPi_installer)1. [Conda Installers](Conda_Installers)1. [Tools to get you started](Tools_to_get_you_started)4. [Assignment wrap-up](Assignment_wrap-up) ---- 1. PyPi installerMaking an pip compatible installer is actually fairly strait forward. A really good guild can be found at [The Hitchhikers Guild to Packageing](https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html). &9989; **DO THIS:**  Try Steps 1-3 and see if you can get a simple PyPi distribution file for your project.  If you get it working, add the setup.py file to your git repository (Do not add the other files).  **_NOTE_** Every project is different and this step is not required for the class. It is only included here as an example to learn how installers are made.  Step A: Create a setup.py fileThe ```setup.py``` file tells pip all the details it needs to add your project to there database.  Here is an example ```setup,py``` file.  If you want to try it, put it in your main git folder and change the values for your program:```pythonfrom distutils.core import setupsetup(    name='see-segment',    version='0.1dev',    description='The simple evolutionary exploration segmentation project',    autor='<NAME>. and <NAME>.',    author_email='<EMAIL>',    packages=['see',],    license='MIT',    long_description=open('README.md').read(),    install_requires=[        'numpy',        'deap',        'argparse',        'opencv-python',        'scoop',     ])``` Step B:  Make distribution (installer) fileThe following command takes the setup.py file and build you a "distribution" file.  Run the command in your main git repository directory```bashpython setup.py sdist```This will create a folder named sdist (do not add this folder to your git repository).  Inside the folder is the installer. In this case my installer is called ```./dist/see-segment-0.1dev.tar.gz``` Step C: Test the distribution fileTo test the installer I recommend creating a temporary conda environment and see if you can git it to work.  For example the following command will make a bare bone enviornemtn and activate it:```bashconda create --prefix temp_env pip pythonconda activate ./temp_env```Once the environment is started verify your package is not installed. For exmaple, my package is named see and the following command should give an error:```bashpython>>> import see```Now install using a local repository as follows:```bashpip install ./dist/see-segment-0.1dev.tar.gz```Lets test it again:```bashpython>>> import see``` Step D: Send your project to the PyPi (pip) database**_WARNING_** This is the step that goes beyond playing around and will register your repository. This is **_NOT_** required for CMSE802. I just wanted to give you an idea of how easy it is.**_Also Note:_** This is just a basic overview of the steps and may be missing some details. I highly recommend you review [The Hitchhikers Guild to Packageing](https://the-hitchhikers-guide-to-packaging.readthedocs.io/)1. Go to [http://pypi.python.org](http://pypi.python.org ) and create a login and password. **_NOTE:_** you can also register as a new user on the command line using in the next step.2. Register your project name using the following command (Checks to make sure your name is not already in the system (Change your name if need be)```bashpython setup.py register```3. Upload your distribution using the following command:```bashpython setup.py register sdist upload``` --- 2. Conda InstallerConda installers (aka build recipes) are similar but different to pypi installers. Please read [Conda Build Process](https://docs.conda.io/projects/conda-build/en/latest/concepts/recipe.htmlconda-build-process) to learn more.Mostly conda installers are "wrappers" around other installation databases.  Your instructor is new to conda installers so many of these details are likely incorrect and i was not able to double check the instructions.  If you want to actually get this to work, a  good place to start is to read the documents on [Conda Recipes](https://docs.conda.io/projects/conda-build/en/latest/concepts/recipe.html) Step A: Generate configuration filesUse the following command to generate the basic conda configuration files:```bashconda skeleton pypi build```This should build a directory called build with a meta.yml file in it. Assuming that our project is already registered in PyPi this should be enough to move on to the next step: Step B: Build the conda installer form pipy```bashconda build build```This should run the conda build command on the build directory.  Step C: ????Your instructor got stuck at this point because he did not want to register the library with pypi. However, if you do the above command should generate a file that you can use to register with Conda.  See the documents provided.If anyone gets to this point please contact the instructor and maybe we can work together to figure out the details for these steps. --- 3. Tools to get you startedThere are tons of tools and templates that can help you get started writing the necessary support programs to work with PyPi and Conda install database. Consider using your favorite search engine and seeing if you can find a tool that works for you.  For example, although I have not tried it the following tool looks interesting:* https://github.com/takluyver/flit &9989; **DO THIS:** See if you can find other tools that help with packaging your project.  Share the URL in the assignment summary field on the Assignment Wrap-up Put your URL(s) here.  ---- 4. Assignment wrap-upPlease fill out the form that appears when you run the code below.  **You must completely fill this out in order to receive credit for the assignment!**[Direct Link to Google Form](https://cmse.msu.edu/cmse802-pc-survey)If you have trouble with the embedded form, please make sure you log on with your MSU google account at [googleapps.msu.edu](https://googleapps.msu.edu) and then click on the direct link above. &9989; **Assignment-Specific QUESTION:** Where you able to get a pypi installer built.  If not, where did you get stuck? Put your answer to the above question here &9989; **QUESTION:**  Summarize what you did in this assignment. Put your answer to the above question here &9989; **QUESTION:**  What questions do you have, if any, about any of the topics discussed in this assignment after working through the jupyter notebook? Put your answer to the above question here &9989; **QUESTION:**  How well do you feel this assignment helped you to achieve a better understanding of the above mentioned topic(s)? Put your answer to the above question here &9989; **QUESTION:** What was the **most** challenging part of this assignment for you?  Put your answer to the above question here &9989; **QUESTION:** What was the **least** challenging part of this assignment for you?  Put your answer to the above question here &9989; **QUESTION:**  What kind of additional questions or support, if any, do you feel you need to have a better understanding of the content in this assignment? Put your answer to the above question here &9989; **QUESTION:**  Do you have any further questions or comments about this material, or anything else that's going on in class? Put your answer to the above question here &9989; **QUESTION:** Approximately how long did this pre-class assignment take? Put your answer to the above question here<jupyter_code>from IPython.display import HTML
HTML(
"""
<iframe 
	src="https://cmse.msu.edu/cmse802-pc-survey?embedded=true" 
	width="100%" 
	height="1200px" 
	frameborder="0" 
	marginheight="0" 
	marginwidth="0">
	Loading...
</iframe>
"""
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07430848570089077, 'fraction_numerical': 0.010314111579934365, 'mean_word_length': 4.606438896189225, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 16, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '472108', 'license': 'MIT', 'n_tokens_mistral': 2255, 'n_tokens_neox': 2110, 'n_words': 1201, 'path': 'cmse802-s20/0412--Installers-pre-class-assignment.ipynb', 'repo_name': 'Diane1306/cmse802_git_CompModelling', 'size': '8544'}