Giter VIP home page Giter VIP logo

mareposa's Introduction

Product Name

la maREPOsa automates the creation of your remote GitHub & local git repositories, .gitignore and README.md files in just one single line of code.

PyPI version License: MIT Flattr this

Successfully tested on:

Almost every developer, who works with git, executes a certain algorithm to create projects. Probably hundreds of times throughout their career. The goal of maREPOsa is to replace this algorithm with one single terminal command.

The old algorithm

- go to GitHub
- create project

# assuming that you already have files in your project's directory
- git init 
- git add .
- git commit -m"start project"
- git remote add origin https://github.com/USER/REPO

# You might also want to generate a `.gitignore` file by going to [www.gitignore.io](https://www.gitignore.io)

# You might want to look for a `README.md` template for your project. 

You see the tremendous work and web surfing you have to invest for setting up a project.

The new algorithm

# do this once
pip install mareposa

# do for example this the rest of your life
mareposa create -g -l --gh-user USER_NAME --repo-name REPO_NAME --ignore "python,pycharm,linux" --readme detailed

You can also use maREPOsa e.g. to only create a configured .gitignore file or a README.md template.

Installation

OS X & Linux & Windows:

The installation should be the same for everyone but by now it was only tested on Mac OS X and Ubuntu:

pip install mareposa

Usage

To get an overview what mareposa can, start with ...

$ mareposa create --help

Usage: mareposa create [OPTIONS]

Options:
  -l, --locally                   Initiate a git repository locally and commit
                                  all existing files of the current directory.
  -g, --github-repo               Create a remote repository on GitHub. To
                                  create a new remote GitHub repo, please
                                  provide your registered --gh-user (GitHub
                                  username) and your new --repo-name
  --gh-user TEXT                  User name of the owner of the new repository.
  --repo-name TEXT                Your new repository name.
  -i, --ignore TEXT               Create a .gitignore file with files and
                                  names to ignore. Provide the technologies to
                                  ignore separated by come, e.g. eclipse,java
                                  etc. For full list of possible technologies
                                  refer to `mareposa info --ignore-list`.
                                  Please check the .gitignore file thoroughly
                                  to know exactly what will be ignored.
  -r, --readme [blank|light|detailed]
                                  Create a README.md
  --help                          Show this message and exit.

Now you can do the complete initialization of your project in just one step:

$ mareposa create --locally --github-repo --gh-user USER_NAME --repo-name REPO_NAME --ignore "python,pycharm,linux" --readme detailed

You can also only generate a .gitignore file if you already have a project:

# create a .gitignore file with default ignorables from https://www.gitignore.io for the technologies you plan to work with
$ mareposa create --ignore "python,pycharm,linux"

Or create a verbose README template, like the one you are reading right now:

$ mareposa create --readme detailed

Or just create a blank one to fill it later

$ mareposa create --readme blank

If you have already created a remote repo and you have your first commit ready to push, you can also just perform add-commit-push like this:

$ mareposa create --locally --gh-user GUTHUB_USER_NAME --repo-name YOUR_REPO

Please be aware that maREPOsa is in its early beta phase and can generate unexpected behaviour.

Development setup if you like to contribute

The quickest way to get started is to git clone the repository and after you have made some changes to run the script with python cli.py mareposa create --locally from the mareposa directory.

Also consider installing pipsi to install maREPOsa. It is another kind of pip. It will automatically install maREPOsa and its isolated venv dependencies in your /Users/USER_NAME/.local/ directory.

Here are the installation instructions for pipsi.

If you installed maREPOsa with pip already, you may want to uninstall it first.

With pipsi you can then easily install maREPOsa locally and build the application after changes if you need:

git clone https://github.com/RichStone/mareposa
cd mareposa
pipsi install --editable .

# sometimes you will make some changes that need a fresh install of maREPOsa
# MAKE SICK CHANGES
# reinstall maREPOsa

pipsi uninstall maREPOsa
pipsi install --editable .

You may also be able to do all of this by just using pip but this is how my workflow was and I found it quite handy.

(tox is also set up but the tests aren't yet)

Release History

  • 1.0.2
    • FIX: dangerous --locally behaviour
  • 1.0.0
    • ADD: Main functionallity
  • 0.2.0
    • Work in progress

Meta

Richard Steinmetz – Connect on LinkedIn

Distributed under the MIT license. See LICENSE.txt for more information.

My GitHub account Twitter

How I kickstarted this project

I have built the foundation in just one day. I called it a Code Sprint later and made a little methodology framework out of it: Vode Sprint on datagoodie.com

Future Features and Enhancements Ideas

just some ideas and necessities that popped into my mind

  • add license option
  • add mareposa push/-p -m “your new commit message” command for git add-commit-push
  • automate mkdir new-project && cd new-project
  • prompt user if a .git repo/remote upstream already exists locally
  • catch failed pushes
  • summarize what was successful (and what maybe failed) as feedback for the user
  • Fancy Welcome screen
  • more detailed text on create command without locally or remotely?
  • better visuals
  • set credentials
  • set default license
  • set default ignores
  • set message, if no gitignore technology available
  • Set your own default README.md

future refactorings Ideas

  • take out texts in a map file
  • have bash commands in own class
  • add offline support for README, LICENSE.txt and gitignore

let me know in the issues if you have new ideas or if you found bugs to be fixed.

mareposa's People

Contributors

richstone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

florentdrousset

mareposa's Issues

Windows 8: --locally command doesn't work - The system cannot find the file specified

Traceback (most recent call last):
  File "C:\Python37\Scripts\mareposa-script.py", line 11, in <module>
    load_entry_point('mareposa==1.0.1', 'console_scripts', 'mareposa')()
  File "c:\python37\lib\site-packages\click\core.py", line 764, in __call_
    return self.main(*args, **kwargs)
  File "c:\python37\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\python37\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python37\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python37\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\python37\lib\site-packages\mareposa\cli.py", line 51, in create
    ['git', 'commit', '-m"start project"']
  File "c:\python37\lib\site-packages\mareposa\cli.py", line 68, in bash_e
    process = subprocess.Popen(command, stdout=subprocess.PIPE)
  File "c:\python37\lib\subprocess.py", line 756, in __init__
    restore_signals, start_new_session)
  File "c:\python37\lib\subprocess.py", line 1155, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

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.